Class: ActiveRecord::Bixformer::To::Csv
- Inherits:
-
Compiler
- Object
- Compiler
- ActiveRecord::Bixformer::To::Csv
show all
- Defined in:
- lib/activerecord-bixformer/to/csv.rb
Instance Method Summary
collapse
Methods inherited from Compiler
#compile, #should_be_included
Constructor Details
#initialize(plan) ⇒ Csv
5
6
7
|
# File 'lib/activerecord-bixformer/to/csv.rb', line 5
def initialize(plan)
super(:csv, plan)
end
|
Instance Method Details
#clear ⇒ Object
9
10
11
12
13
|
# File 'lib/activerecord-bixformer/to/csv.rb', line 9
def clear
super
@csv_title_row = nil
end
|
#csv_body_row(activerecord) ⇒ Object
19
20
21
22
23
|
# File 'lib/activerecord-bixformer/to/csv.rb', line 19
def csv_body_row(activerecord)
body_map = compile.export(activerecord)
csv_title_row.map { |title| body_map[title] }
end
|
#csv_title_row ⇒ Object
15
16
17
|
# File 'lib/activerecord-bixformer/to/csv.rb', line 15
def csv_title_row
@csv_title_row ||= compile.csv_titles
end
|