Class: Acb::Column
- Inherits:
-
Object
- Object
- Acb::Column
- Defined in:
- lib/acb/column.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #digest(row) ⇒ Object
-
#initialize(name, **options) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(name, **options) ⇒ Column
Returns a new instance of Column.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/acb/column.rb', line 7 def initialize(name, **) @name = name @index = case [:index] when Proc [:index] when String [:index].split('.') else [name] end @format = [:format] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/acb/column.rb', line 5 def name @name end |
Instance Method Details
#digest(row) ⇒ Object
20 21 22 23 |
# File 'lib/acb/column.rb', line 20 def digest(row) data = _digest(row) @format && data ? format(data) : data end |