lib/asynchro/state.rb
# This lets the object instance function as a simple DSL by allowing
# arbitrary method names to map to various functions.
This lets the object instance function as a simple DSL by allowing
arbitrary method names to map to various functions.
This lets the object instance function as a simple DSL by allowing arbitrary method names to map to various functions .
def method_missing(name, *args, &block)
    name_s = name.to_s
    if (args.empty?)
      case (name)
      when /\?$/
        self.declared?(name_s.sub(/\?$/, ''))
      when /\!$/
        self.run!(name_s.sub(/\!$/, ''))
      else
        self.declare(name, &block)
      end
    else
      super(name, *args)
    end
  end
def method_missing ( name , * args , & block ) name_s = name . to_s if ( args . empty? ) case ( name ) when / \? $ / self . declared? ( name_s . sub ( / \? $ / , '' ) ) when / \! $ / self . run! ( name_s . sub ( / \! $ / , '' ) ) else self . declare ( name , & block ) end else super ( name , * args ) end end
This lets the object instance function as a simple DSL by allowing
arbitrary method names to map to various functions.
This lets the object instance function as a simple DSL by allowing arbitrary method names to map to various functions .
name
<not_specific>
args
<not_specific>
block
<not_specific>