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.
- #stop_anchors ⇒ Object
Instance Method Details
#anchor(obj_or_binding, opts = {}) ⇒ Rib::Skip
Enter an interactive Rib shell based on a particular context.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/rib/more/anchor.rb', line 54 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 |