Module: Rib::Anchor
- Extended by:
- Plugin
- Defined in:
- lib/rib/more/anchor.rb
Defined Under Namespace
Modules: Imp
Instance Attribute Summary
Attributes included from Plugin
Instance Method Summary collapse
-
#bound_object ⇒ Object
override Underscore#bound_object.
-
#loop_eval(str) ⇒ Object
————— Rib API —————.
- #prompt ⇒ Object
Methods included from Plugin
disable, disabled?, enable, enabled?, extended
Instance Method Details
#bound_object ⇒ Object
override Underscore#bound_object
37 38 39 40 41 |
# File 'lib/rib/more/anchor.rb', line 37 def bound_object return super if Rib::Anchor.disabled? return super if eval_binding.kind_of?(Binding) eval_binding end |
#loop_eval(str) ⇒ Object
————— Rib API —————
10 11 12 13 14 15 16 17 |
# File 'lib/rib/more/anchor.rb', line 10 def loop_eval str return super if Rib::Anchor.disabled? if eval_binding.kind_of?(Binding) super else eval_binding.instance_eval(str, "(#{name})", line) end end |
#prompt ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rib/more/anchor.rb', line 19 def prompt return super if Rib::Anchor.disabled? return super unless config[:prompt_anchor] level = "(#{Rib.shells.size - 1})" if Rib.const_defined?(:Color) && kind_of?(Rib::Color) && Rib::Color.enabled? "#{format_color(eval_binding, prompt_anchor)}#{level}#{super}" else "#{prompt_anchor}#{level}#{super}" end end |