Module: Acb::Base

Extended by:
ActiveSupport::Concern
Included in:
Acb
Defined in:
lib/acb/base.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

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(**options)
  CSV.generate(**options) do |csv|
    csv << self.class.header
    data.each do |row|
      csv << summarize(row)
    end
  end
end