Class: KathyLee::Attributes
- Inherits:
-
Object
- Object
- KathyLee::Attributes
- Defined in:
- lib/kathy_lee/attributes.rb
Defined Under Namespace
Classes: Binding
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#code_block ⇒ Object
Returns the value of attribute code_block.
Instance Method Summary collapse
-
#initialize(attributes = {}, &block) ⇒ Attributes
constructor
A new instance of Attributes.
- #process(attribs = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}, &block) ⇒ Attributes
Returns a new instance of Attributes.
6 7 8 9 |
# File 'lib/kathy_lee/attributes.rb', line 6 def initialize(attributes = {}, &block) self.attributes = attributes self.code_block = block end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/kathy_lee/attributes.rb', line 3 def attributes @attributes end |
#code_block ⇒ Object
Returns the value of attribute code_block.
4 5 6 |
# File 'lib/kathy_lee/attributes.rb', line 4 def code_block @code_block end |
Instance Method Details
#process(attribs = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/kathy_lee/attributes.rb', line 11 def process(attribs = {}) b = KathyLee::Attributes::Binding.new(self.attributes.merge(attribs), &self.code_block) b.process! return b.results end |