Class: Nestene::AutonState

Inherits:
Object
  • Object
show all
Includes:
StructureMapper::Hash
Defined in:
lib/nestene/auton_state.rb

Instance Method Summary collapse

Constructor Details

#initializeAutonState

Returns a new instance of AutonState.



6
7
8
# File 'lib/nestene/auton_state.rb', line 6

def initialize
  self.queue=AutonExecutionQueue.new
end

Instance Method Details

#stateObject



10
11
12
13
14
15
16
# File 'lib/nestene/auton_state.rb', line 10

def state
  if queue.currently_executing == nil
    queue.failed ? :failed : :ready
  else
    :running
  end
end

#type_as_classObject



22
23
24
# File 'lib/nestene/auton_state.rb', line 22

def type_as_class
  self.type ? Nestene::class_from_string(self.type) : nil
end