Module: Acb::Base
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #load_from(relations) ⇒ Object
- #to_csv(**options) ⇒ Object (also: #content_string)
Instance Method Details
#load_from(relations) ⇒ Object
21 22 23 |
# File 'lib/acb/base.rb', line 21 def load_from(relations) @data = relations end |
#to_csv(**options) ⇒ Object Also known as: content_string
11 12 13 14 15 16 17 18 |
# File 'lib/acb/base.rb', line 11 def to_csv(**) CSV.generate(**) do |csv| csv << self.class.header data.each do |row| csv << summarize(row) end end end |