Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module InstanceMethods
- def const_lookup
- self.class::A
- end
- end
- class Consts
- A = "Hello World"
- include InstanceMethods
- end
- c = Consts.new
- puts c.const_lookup
- sneaky:~ rsl$ ruby test.rb
- Hello World
Add Comment
Please, Sign In to add comment