Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Base
- def self.included(ed)
- ed.instance_eval do
- def load_const(name)
- puts "FINDING CONST NAMED #{name}"
- end
- end
- end
- end
- class Ed
- include Base
- MYCONST = load_const(rand(10000))
- end
- # Only runs load_const once
- 10.times{ Ed.new }
Add Comment
Please, Sign In to add comment