storage/mroonga/vendor/groonga/lib/mrb/scripts/eval_context.rb
raw| 1 | module Groonga |
| 2 | class EvalContext |
| 3 | def eval(script) |
| 4 | proc = compile(script) |
| 5 | instance_eval(&proc) |
| 6 | end |
| 7 | |
| 8 | def method_missing(id, *args, &block) |
| 9 | return super unless args.empty? |
| 10 | return super if block_given? |
| 11 | |
| 12 | object = Context.instance[id.to_s] |
| 13 | return super if object.nil? |
| 14 | |
| 15 | object |
| 16 | end |
| 17 | end |
| 18 | end |