Last active
March 21, 2019 16:20
-
-
Save spreered/2a749ebaee8f8f8461b4a9519f69fc97 to your computer and use it in GitHub Desktop.
Ruby object model
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 Dog | |
def get_name(name) | |
@name = name | |
end | |
def bark | |
puts "My name is #{@name}!" | |
end | |
end | |
bingo = Dog.new | |
bingo.get_name("Bingo") | |
bingo.bark # => My name is Bingo! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment