mirror of
https://github.com/lloeki/package-ruby.git
synced 2025-12-06 01:54:41 +01:00
preview
This commit is contained in:
commit
32b99b62bf
20 changed files with 644 additions and 0 deletions
38
test2.rb
Normal file
38
test2.rb
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
require 'pp'
|
||||
#require 'pry'
|
||||
require 'binding_of_caller'
|
||||
|
||||
def cards
|
||||
ace = 'of hearts'
|
||||
queen = 'of diamonds'
|
||||
binding
|
||||
end
|
||||
|
||||
c = cards
|
||||
|
||||
pp c.eval('ace')
|
||||
pp c.eval('ace = "of spades"')
|
||||
pp c.eval('ace')
|
||||
pp c.eval('foo = 42')
|
||||
pp c.eval('foo')
|
||||
|
||||
def set_baz(b)
|
||||
b.eval('baz = 44')
|
||||
pp b.eval('baz')
|
||||
pp binding.callers
|
||||
end
|
||||
|
||||
def meh
|
||||
foo = 42
|
||||
bar = 43
|
||||
#baz = nil
|
||||
|
||||
set_baz binding
|
||||
binding
|
||||
end
|
||||
|
||||
m = meh
|
||||
|
||||
pp m.eval('foo')
|
||||
pp m.eval('bar')
|
||||
pp m.eval('baz')
|
||||
Loading…
Add table
Add a link
Reference in a new issue