Class: BomDB::Export::Editions
- Inherits:
-
Base
- Object
- Base
- BomDB::Export::Editions
show all
- Defined in:
- lib/bomdb/export/editions.rb
Instance Attribute Summary
Attributes inherited from Base
#db, #opts
Instance Method Summary
collapse
Methods inherited from Base
#export, #initialize
Instance Method Details
#export_json ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/bomdb/export/editions.rb', line 6
def export_json
editions = []
select_editions.each do |e|
editions << JSON::generate([e[:edition_year], e[:edition_name]], array_nl: ' ')
end
Export::Result.new(success: true, body: "[\n " + editions.join(",\n ") + "\n]\n")
end
|
#export_text ⇒ Object
14
15
16
|
# File 'lib/bomdb/export/editions.rb', line 14
def export_text
Export::Result.new(success: true, body: select_editions.map{ |e| e[:edition_name] }.join("\n"))
end
|