Class: LotusAdmin::Exporter::Column
- Inherits:
-
Object
- Object
- LotusAdmin::Exporter::Column
- Defined in:
- app/services/lotus_admin/exporter.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #data(model) ⇒ Object
-
#initialize(attribute_name, title, &block) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(attribute_name, title, &block) ⇒ Column
Returns a new instance of Column.
17 18 19 20 21 |
# File 'app/services/lotus_admin/exporter.rb', line 17 def initialize(attribute_name, title, &block) @attribute_name = attribute_name @title = title @block = block || ->(model){ model.public_send(attribute_name) } end |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
16 17 18 |
# File 'app/services/lotus_admin/exporter.rb', line 16 def attribute_name @attribute_name end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
16 17 18 |
# File 'app/services/lotus_admin/exporter.rb', line 16 def block @block end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
16 17 18 |
# File 'app/services/lotus_admin/exporter.rb', line 16 def title @title end |
Instance Method Details
#data(model) ⇒ Object
23 24 25 |
# File 'app/services/lotus_admin/exporter.rb', line 23 def data(model) block.call(model) end |