Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo
- def bar
- :baz
- end
- def self.baz
- :bar
- end
- end
- #=> nil
- foo = Foo.new
- # returns a new Foo object, foo
- foo.bar
- #=> :baz
- # This is how we normally declare our classes.
- # I think that this is because this is how we teach
- # other languages, so teaching Ruby this way is just easier.
- # However, there are other ways we can do things.
Add Comment
Please, Sign In to add comment