Class: Progression::Progression

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Progression

Returns a new instance of Progression.



25
26
27
28
# File 'lib/progression.rb', line 25

def initialize(&block)
  @steps = []
  instance_exec &block if block_given?
end

Instance Attribute Details

#stepsObject (readonly)

Returns the value of attribute steps.



23
24
25
# File 'lib/progression.rb', line 23

def steps
  @steps
end

Instance Method Details

#progress_for(object) ⇒ Object



30
31
32
# File 'lib/progression.rb', line 30

def progress_for(object)
  Progress.new(object, steps)
end