Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class User
  2. def self.foo
  3. "foo"
  4. end
  5. end
  6.  
  7. class Post
  8. puts Post::User.foo
  9. end
  10. # => warning: toplevel constant User referenced by Post::User
  11. # => foo
  12.  
  13. module User
  14. def self.foo
  15. "foo"
  16. end
  17. end
  18.  
  19. module Post
  20. puts Post::User.foo
  21. end
  22. # => uninitialized constant Post::User (NameError)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement