Created
August 22, 2016 12:09
-
-
Save crossphd/f032cbeb1620641f66b223333b097e5b to your computer and use it in GitHub Desktop.
Firehose Quiz 3: Dog Class
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 | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def talk | |
puts "woof woof" | |
end | |
def read_dogtag | |
puts "my name is #{name}" | |
end | |
end | |
dog1 = Dog.new("Sparky") | |
dog1.talk | |
dog1.read_dogtag | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment