Parent

Class/Module Index [+]

Quicksearch

Deltacloud::StateMachine

Attributes

states[R]

Public Class Methods

new(&block) click to toggle source
# File lib/deltacloud/state_machine.rb, line 21
def initialize(&block)
  @states  = []
  instance_eval &block if block
end

Public Instance Methods

finish() click to toggle source
# File lib/deltacloud/state_machine.rb, line 30
def finish()
  state(:finish)
end
method_missing(sym,*args) click to toggle source
# File lib/deltacloud/state_machine.rb, line 43
def method_missing(sym,*args)
  return state( sym ) if ( args.empty? )
  super( sym, *args )
end
start() click to toggle source
# File lib/deltacloud/state_machine.rb, line 26
def start()
  state(:start)
end
state(name) click to toggle source
# File lib/deltacloud/state_machine.rb, line 34
def state(name)
  state = @states.find{|e| e.name == name.to_sym}
  if ( state.nil? )
    state = State.new( self, name.to_sym )
    @states << state
  end
  state
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.