Class: Progression::Step
- Inherits:
-
Object
- Object
- Progression::Step
- Defined in:
- lib/progression.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #evaluate(object) ⇒ Object
-
#initialize(name, &block) ⇒ Step
constructor
A new instance of Step.
Constructor Details
#initialize(name, &block) ⇒ Step
Returns a new instance of Step.
88 89 90 |
# File 'lib/progression.rb', line 88 def initialize(name, &block) @name, @block = name, block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
86 87 88 |
# File 'lib/progression.rb', line 86 def name @name end |
Instance Method Details
#evaluate(object) ⇒ Object
92 93 94 |
# File 'lib/progression.rb', line 92 def evaluate(object) object.instance_exec &@block end |