unless defined? $__fsm_system__ $__fsm_system__ = __FILE__ module FSM FSM::LIBDIR = File::dirname(File::expand_path(__FILE__)) + File::SEPARATOR unless defined? FSM::LIBDIR FSM::INCDIR = File::dirname(FSM::LIBDIR) + File::SEPARATOR unless defined? FSM::INCDIR require INCDIR + 'fsm' class System include Util %w[ fsm observer ].each{|a| attr a} def initialize fsm = FSM.new, &b @fsm = fsm @observer = Observer.new @fsm @dsl = DSL.new self configure &b if b end def configure &b @dsl.configure &b end delegate %w[ graph state_attributes state subscribers subscribe inspect start add_observer transition traverse input add_state add_transition plot to_dot display ] => '@fsm' delegate %w[ on on_entry on_transition on_exit on_input join kill stop ] => '@observer' end # class System end # module FSM end