Class: ActiveAdmin::Xls::Builder::Column
- Inherits:
-
Object
- Object
- ActiveAdmin::Xls::Builder::Column
- Defined in:
- lib/active_admin/xls/builder.rb
Overview
Xls column
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, block = nil) ⇒ Column
constructor
A new instance of Column.
- #localized_name(i18n_scope = nil) ⇒ Object
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
169 170 171 |
# File 'lib/active_admin/xls/builder.rb', line 169 def data @data end |
#name ⇒ Object (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 |