Class: ActiveAdmin::CSVBuilder::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/active_admin/csv_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block = nil) ⇒ Column

Returns a new instance of Column.



39
40
41
42
# File 'lib/active_admin/csv_builder.rb', line 39

def initialize(name, block = nil)
  @name = name.is_a?(Symbol) ? name.to_s.titleize : name
  @data = block || name.to_sym
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



37
38
39
# File 'lib/active_admin/csv_builder.rb', line 37

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



37
38
39
# File 'lib/active_admin/csv_builder.rb', line 37

def name
  @name
end