Module: Ripl::Rc::Anchor
- Includes:
- U
- Defined in:
- lib/ripl/rc/anchor.rb
Defined Under Namespace
Instance Method Summary collapse
- #loop_eval(str) ⇒ Object
-
#print_result(result) ⇒ Object
if the object is the same, then we’re exiting from an anchor, so don’t print anything.
- #prompt ⇒ Object
Methods included from U
Methods included from SqueezeHistory::Imp
Methods included from StripBacktrace::Imp
#cwd, #home, #snip, #strip_backtrace
Methods included from Imp
Methods included from Color::Imp
#black, #blue, #color, #colors, #cyan, #find_color, #green, #magenta, #red, #reset, #white, #yellow
Instance Method Details
#loop_eval(str) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/ripl/rc/anchor.rb', line 7 def loop_eval(str) case obj_or_binding = (config[:rc_anchor] ||= []).last when NilClass super when Binding @binding = obj_or_binding super else obj_or_binding.instance_eval(str, "(#{@name})", @line) end end |
#print_result(result) ⇒ Object
if the object is the same, then we’re exiting from an anchor, so don’t print anything.
33 34 35 36 |
# File 'lib/ripl/rc/anchor.rb', line 33 def print_result result super unless !result.nil? && result.object_id == Ripl.config[:rc_anchor_last].object_id end |