Guest User

Untitled

a guest
Oct 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class Cool
  2. @var
  3.  
  4. def test
  5. @var = "test"
  6. puts @var.inspect
  7. end
  8. end
  9.  
  10. class Ok
  11. def initialize
  12. Cool::test
  13. end
  14. end
  15.  
  16. obj = Ok.new
  17.  
  18.  
  19. # --- output
  20.  
  21. #test.rb:12:in `initialize': private method `test' called for Cool:Class (NoMethodError)
  22. # from test.rb:16:in `new'
  23. # from test.rb:16:in `<main>'
Add Comment
Please, Sign In to add comment