Class: IRB::Context

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

Instance Method Summary collapse

Instance Method Details

#evaluate(*args, &block) ⇒ Object

Add before_eval, after_eval, and around_eval callbacks without damaging original behavior.



93
94
95
96
97
98
99
100
101
# File 'lib/irb_callbacks.rb', line 93

def evaluate(*args, &block)
  IRB::before_eval
  value = nil
  IRB::around_eval do
    value = original_evaluate(*args, &block)
  end
  IRB::after_eval
  value
end

#original_evaluateObject



90
# File 'lib/irb_callbacks.rb', line 90

alias original_evaluate evaluate