Class: Methodical::Checklist

Inherits:
Array
  • Object
show all
Defined in:
lib/methodical/checklist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title) ⇒ Checklist

Returns a new instance of Checklist.



8
9
10
11
# File 'lib/methodical/checklist.rb', line 8

def initialize(title)
  @title = title
  super([])
end

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



6
7
8
# File 'lib/methodical/checklist.rb', line 6

def title
  @title
end

Instance Method Details

#<<(object) ⇒ Object

Raises:

  • (ArgumentError)


23
24
25
26
27
# File 'lib/methodical/checklist.rb', line 23

def <<(object)
  raise ArgumentError, "No nils allowed" if object.nil?
  super(object)
  object
end

#new_walkthroughObject



13
14
15
# File 'lib/methodical/checklist.rb', line 13

def new_walkthrough
  Walkthrough.new(self)
end

#perform_walkthrough!(baton = nil, raise_on_error = false, &block) ⇒ Object



17
18
19
20
21
# File 'lib/methodical/checklist.rb', line 17

def perform_walkthrough!(baton=nil, raise_on_error=false, &block)
  walkthrough = new_walkthrough
  walkthrough.perform!(baton, raise_on_error, &block)
  walkthrough
end