Class: Progression::Step

Inherits:
Object
  • Object
show all
Defined in:
lib/progression.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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