Class: ActiveAdmin::Xls::Builder::Column

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

Overview

Xls column

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block = nil) ⇒ Column

Returns a new instance of Column.



164
165
166
167
# File 'lib/active_admin/xls/builder.rb', line 164

def initialize(name, block = nil)
  @name = name
  @data = block || @name
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



169
170
171
# File 'lib/active_admin/xls/builder.rb', line 169

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



169
170
171
# File 'lib/active_admin/xls/builder.rb', line 169

def name
  @name
end

Instance Method Details

#localized_name(i18n_scope = nil) ⇒ Object



171
172
173
174
# File 'lib/active_admin/xls/builder.rb', line 171

def localized_name(i18n_scope = nil)
  return name.to_s.titleize unless i18n_scope
  I18n.t name, scope: i18n_scope
end