Class: ActiveAdmin::Axlsx::Builder::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block = nil) ⇒ Column

Returns a new instance of Column.



131
132
133
134
# File 'lib/active_admin/axlsx/builder.rb', line 131

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

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



136
137
138
# File 'lib/active_admin/axlsx/builder.rb', line 136

def data
  @data
end

#nameObject (readonly)

Returns the value of attribute name.



136
137
138
# File 'lib/active_admin/axlsx/builder.rb', line 136

def name
  @name
end

Instance Method Details

#localized_name(i18n_scope = nil) ⇒ Object



138
139
140
141
# File 'lib/active_admin/axlsx/builder.rb', line 138

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