Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. class Foo
  2. def bar
  3. :baz
  4. end
  5.  
  6. def self.baz
  7. :bar
  8. end
  9. end
  10. #=> nil
  11.  
  12. foo = Foo.new
  13. # returns a new Foo object, foo
  14.  
  15. foo.bar
  16. #=> :baz
  17.  
  18. # This is how we normally declare our classes.
  19. # I think that this is because this is how we teach
  20. # other languages, so teaching Ruby this way is just easier.
  21. # However, there are other ways we can do things.
Add Comment
Please, Sign In to add comment