Class: Remont::Attribute
- Inherits:
-
Object
- Object
- Remont::Attribute
- Defined in:
- lib/remont/attribute.rb
Instance Attribute Summary collapse
- #name ⇒ Symbol readonly
Instance Method Summary collapse
-
#initialize(name, opts = {}, &processor) ⇒ Attribute
constructor
A new instance of Attribute.
- #process(value, record) ⇒ Object
Constructor Details
#initialize(name, opts = {}, &processor) ⇒ Attribute
Returns a new instance of Attribute.
10 11 12 13 |
# File 'lib/remont/attribute.rb', line 10 def initialize(name, opts = {}, &processor) @name = name @processor = opts.fetch(:using, processor) end |
Instance Attribute Details
#name ⇒ Symbol (readonly)
4 5 6 |
# File 'lib/remont/attribute.rb', line 4 def name @name end |
Instance Method Details
#process(value, record) ⇒ Object
18 19 20 |
# File 'lib/remont/attribute.rb', line 18 def process(value, record) processor.call(value, record) end |