Class: Para::Exporter::Table

Inherits:
Base show all
Defined in:
lib/para/exporter/table.rb

Direct Known Subclasses

Csv, Xls

Instance Attribute Summary

Attributes inherited from Base

#model, #name, #options

Instance Method Summary collapse

Methods inherited from Base

#file, #file_name, #perform

Instance Method Details

#headersObject



10
11
12
13
14
# File 'lib/para/exporter/table.rb', line 10

def headers
  fields.map do |field|
    encode(model.human_attribute_name(field))
  end
end

#row_for(resource) ⇒ Object



16
17
18
19
20
# File 'lib/para/exporter/table.rb', line 16

def row_for(resource)
  fields.map do |field|
    encode(resource.send(field))
  end
end