Class: ActionFactory::Assignments::Attribute
- Inherits:
-
Object
- Object
- ActionFactory::Assignments::Attribute
- Defined in:
- lib/action_factory/assignments/attribute.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #compile(factory) ⇒ Object
-
#initialize(block) ⇒ Attribute
constructor
A new instance of Attribute.
Constructor Details
#initialize(block) ⇒ Attribute
Returns a new instance of Attribute.
8 9 10 |
# File 'lib/action_factory/assignments/attribute.rb', line 8 def initialize(block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/action_factory/assignments/attribute.rb', line 6 def block @block end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/action_factory/assignments/attribute.rb', line 16 def ==(other) other.is_a?(self.class) && other.block == @block end |
#compile(factory) ⇒ Object
12 13 14 |
# File 'lib/action_factory/assignments/attribute.rb', line 12 def compile(factory) factory.instance_exec(&@block) end |