Guest User

Untitled

a guest
Jun 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. module Base
  2. def self.included(ed)
  3. ed.instance_eval do
  4. def load_const(name)
  5. puts "FINDING CONST NAMED #{name}"
  6. end
  7. end
  8. end
  9. end
  10.  
  11. class Ed
  12. include Base
  13. MYCONST = load_const(rand(10000))
  14. end
  15.  
  16. # Only runs load_const once
  17. 10.times{ Ed.new }
Add Comment
Please, Sign In to add comment