In Files

  • mrbgems/mruby-method/test/method.rb

Interpreter

Constants

Dispatcher

Attributes

ret[RW]

Public Instance Methods

do_a() click to toggle source
 
               # File mrbgems/mruby-method/test/method.rb, line 12
def do_a() @ret += "there, "; end
            
do_d() click to toggle source
 
               # File mrbgems/mruby-method/test/method.rb, line 13
def do_d() @ret += "Hello ";  end
            
do_e() click to toggle source
 
               # File mrbgems/mruby-method/test/method.rb, line 14
def do_e() @ret += "!\n";     end
            
do_v() click to toggle source
 
               # File mrbgems/mruby-method/test/method.rb, line 15
def do_v() @ret += "Dave";    end
            
interpret(string) click to toggle source
 
               # File mrbgems/mruby-method/test/method.rb, line 22
def interpret(string)
  @ret = ""
  string.each_char {|b| Dispatcher[b].bind(self).call }
end