Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/live_ast/replace_eval.rb

Overview

Overrides for Module#module_eval and Module#class_eval

Instance Method Summary collapse

Instance Method Details

#live_ast_original_module_evalObject



94
# File 'lib/live_ast/replace_eval.rb', line 94

alias live_ast_original_module_eval module_eval

#module_eval(*args, &block) ⇒ Object Also known as: class_eval

Arity must be handled in code because the first argument is only required if no block is passed.



98
99
100
101
102
103
104
105
# File 'lib/live_ast/replace_eval.rb', line 98

def module_eval(*args, &block)
  if block
    live_ast_original_module_eval(*args, &block)
  else
    LiveAST::ReplaceEval
      .module_or_instance_eval(:module, self, Binding.of_caller(1), args)
  end
end