Module: Csvbuilder::Export::Base
- Extended by:
- ActiveSupport::Concern
- Included in:
- Csvbuilder::Export
- Defined in:
- lib/csvbuilder/exporter/concerns/export/base.rb
Instance Method Summary collapse
- #initialize(source_model = nil, context = {}) ⇒ Object
-
#to_row ⇒ Array
An array of public_send(column_name) of the CSV model.
- #to_rows ⇒ Object
Instance Method Details
#initialize(source_model = nil, context = {}) ⇒ Object
15 16 17 18 |
# File 'lib/csvbuilder/exporter/concerns/export/base.rb', line 15 def initialize(source_model = nil, context = {}) @source_model = source_model super(context: context) end |
#to_row ⇒ Array
Returns an array of public_send(column_name) of the CSV model.
25 26 27 |
# File 'lib/csvbuilder/exporter/concerns/export/base.rb', line 25 def to_row original_attributes.values end |
#to_rows ⇒ Object
20 21 22 |
# File 'lib/csvbuilder/exporter/concerns/export/base.rb', line 20 def to_rows [to_row] end |