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.



72
73
74
# File 'lib/progression.rb', line 72

def initialize(name, &block)
  @name, @block = name, block
end

Instance Attribute Details

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