Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### How is method(:bar) scoped in this case? (Within class A? Within class B? neither? Is the new B instance implicitly "self" within the do block?)
- ### The '@' in @var makes var an instance variable?
- ### A.new.foo returns a hash containing the key :key?
- class A
- def foo
- @val = B.new do
- {
- key: method(:bar)
- }
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement