Class: BomDB::Export::Books
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from BomDB::Export::Base
Instance Method Details
#export_json ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/bomdb/export/books.rb', line 6 def export_json books = [] @db[:books].each do |b| books << JSON::generate([ b[:book_name], b[:book_group], b[:book_sort] ], array_nl: ' ') end Export::Result.new(success: true, body: "[\n " + books.join(",\n ") + "\n]\n") end |