Module: IRB
- Defined in:
- lib/tins/xt/irb.rb
Overview
We extend the top level IRB module
Class Method Summary collapse
-
.examine(binding = TOPLEVEL_BINDING) ⇒ Object
Starts an interactive IRB session with the given binding context.
Instance Method Summary collapse
-
#examine(binding = TOPLEVEL_BINDING) ⇒ void
Starts an interactive IRB session examining the current object and its context.
Class Method Details
.examine(binding = TOPLEVEL_BINDING) ⇒ Object
Starts an interactive IRB session with the given binding context. This method creates a new IRB instance and evaluates input from it, allowing for interactive exploration of variables and objects.
40 41 42 43 44 45 46 47 48 |
# File 'lib/tins/xt/irb.rb', line 40 def self.examine(binding = TOPLEVEL_BINDING) setup nil workspace = WorkSpace.new binding irb = Irb.new workspace @CONF[:MAIN_CONTEXT] = irb.context catch(:IRB_EXIT) { irb.eval_input } rescue Interrupt exit end |
Instance Method Details
#examine(binding = TOPLEVEL_BINDING) ⇒ void
This method returns an undefined value.
Starts an interactive IRB session examining the current object and its context. This instance method provides a convenient way to debug objects without explicitly passing bindings.
63 64 65 |
# File 'lib/tins/xt/irb.rb', line 63 def examine(binding = TOPLEVEL_BINDING) IRB.examine(binding) end |