Skip to content

Instantly share code, notes, and snippets.

@crossphd
Created August 22, 2016 12:09
Show Gist options
  • Save crossphd/f032cbeb1620641f66b223333b097e5b to your computer and use it in GitHub Desktop.
Save crossphd/f032cbeb1620641f66b223333b097e5b to your computer and use it in GitHub Desktop.
Firehose Quiz 3: Dog Class
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