Module: HookRepl

Defined in:
lib/repl.rb

Overview

FIXME: not everything unterstands class_eval. Maybe need an “eval in this thing method?”

Class Method Summary collapse

Class Method Details

.replize_object(obj, class_or_instance_or_both = :both) ⇒ Object



17
18
19
20
# File 'lib/repl.rb', line 17

def self.replize_object(obj, class_or_instance_or_both = :both)
  obj.class_eval "extend Repl" if [:class, :both].member?(class_or_instance_or_both)
  obj.class_eval "include Repl" if [:object, :both].member?(class_or_instance_or_both)
end