Class: CoopAl::PathFollower

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

Overview

PathFollower

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(library, starting_state) ⇒ PathFollower

Returns a new instance of PathFollower.



8
9
10
11
# File 'lib/coop_al/path_follower.rb', line 8

def initialize(library, starting_state)
  @library = library
  @state = starting_state
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



6
7
8
# File 'lib/coop_al/path_follower.rb', line 6

def state
  @state
end

Instance Method Details

#follow(paths, log) ⇒ Object



13
14
15
16
17
18
# File 'lib/coop_al/path_follower.rb', line 13

def follow(paths, log)
  paths.each do |path|
    follow_path(path, log)
  end
  @state
end