Last active
September 17, 2015 23:19
-
-
Save ulisesrmzroche/c5a5b8e718a19b368d95 to your computer and use it in GitHub Desktop.
Ruby Class Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vegetable | |
def initialize(name) | |
@name = name | |
end | |
def say_hey | |
puts "Sup' I'm a #{@name}" | |
end | |
end | |
class Tomato < Vegetable | |
def initialize | |
@name = "Tomato" | |
end | |
end | |
tomato = Tomato.new() | |
tomato.say_hey() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment