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.
72 73 74 |
# File 'lib/progression.rb', line 72 def initialize(name, &block) @name, @block = name, block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
70 71 72 |
# File 'lib/progression.rb', line 70 def name @name end |
Instance Method Details
#evaluate(object) ⇒ Object
76 77 78 |
# File 'lib/progression.rb', line 76 def evaluate(object) object.instance_exec &@block end |