Class: Para::Exporter::Csv
- Inherits:
-
Base
- Object
- Base
- Para::Exporter::Csv
show all
- Defined in:
- lib/para/exporter/csv.rb
Instance Attribute Summary
Attributes inherited from Base
#resources
Instance Method Summary
collapse
Methods inherited from Base
#disposition, exports, #file_name, #initialize, #model, register_base_exporter
Instance Method Details
#export_type ⇒ Object
16
17
18
|
# File 'lib/para/exporter/csv.rb', line 16
def export_type
:excel
end
|
#extension ⇒ Object
8
9
10
|
# File 'lib/para/exporter/csv.rb', line 8
def extension
'csv'
end
|
#mime_type ⇒ Object
12
13
14
|
# File 'lib/para/exporter/csv.rb', line 12
def mime_type
'text/csv'
end
|
#render ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'lib/para/exporter/csv.rb', line 20
def render
CSV.generate do |csv|
csv <<
resources.each do |resource|
csv << row_for(resource)
end
end
end
|