module LiveAST::ReplaceEval
Public Class Methods
cache()
click to toggle source
# File lib/live_ast/replace_eval.rb, line 30 def cache Thread.current[:_live_ast_arg_cache] ||= {} end
module_or_instance_eval(which, remote_self, bind, args)
click to toggle source
# File lib/live_ast/replace_eval.rb, line 9 def module_or_instance_eval(which, remote_self, bind, args) handle_args(args) cache[:remote_self] = remote_self cache[:args] = args code = %{ ::LiveAST::ReplaceEval.cache[:remote_self]. live_ast_original_#{which}_eval %{ ::LiveAST.eval( ::LiveAST::ReplaceEval.cache[:args][0], ::Kernel.binding, *::LiveAST::ReplaceEval.cache[:args][1..-1]) } } live_ast_original_eval(code, bind) ensure cache.clear end
Private Class Methods
handle_args(args)
click to toggle source
# File lib/live_ast/replace_eval.rb, line 36 def handle_args(args) LiveAST::Common.check_arity(args, 1..3) args[0] = Common.arg_to_str(args[0]) args[1] = Common.arg_to_str2(args[1]) if args.length > 1 end