Module: Rib::Anchor::Imp
- Included in:
- Rib
- Defined in:
- lib/rib/more/anchor.rb
Instance Method Summary collapse
-
#anchor(obj_or_binding, opts = {}) ⇒ Rib::Skip
Enter an interactive Rib shell based on a particular context.
Instance Method Details
#anchor(obj_or_binding, opts = {}) ⇒ Rib::Skip
Enter an interactive Rib shell based on a particular context.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/rib/more/anchor.rb', line 68 def anchor obj_or_binding, opts={} return if Rib::Anchor.disabled? if Rib.shell.running? Rib.shells << Rib::Shell.new( Rib.shell.config.merge( :binding => obj_or_binding, :prompt_anchor => true ). merge(opts)) else Rib.shell.config.merge!(:binding => obj_or_binding, :prompt_anchor => true ). merge!(opts) end Rib.shell.loop Rib::Skip ensure Rib.shells.pop end |