Created
July 18, 2016 11:59
-
-
Save milothiesen/0964e4d5a0ebb2b69cb8ade830ce2d92 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 :bark, :run | |
def initialize(bark, run) | |
@bark = bark | |
@run = run | |
end | |
end | |
class Pony | |
attr_accessor :gallop, :trot | |
def initialize(gallop, trot) | |
@gallop = gallop | |
@trot = trot | |
end | |
end | |
class Mountain | |
attr_accessor :peak, :timberline | |
def initialize(peak, timberline) | |
@peak = peak | |
@timberline = timberline | |
end | |
end | |
dog = Dog.new("arf!!", "so fast!") | |
puts dog | |
puts dog.bark | |
puts dog.run | |
pony = Pony.new("faster!!", "starting out slow!") | |
puts pony | |
puts pony.gallop | |
puts pony.trot | |
mountain = Mountain.new("we're at the top.", "the trees stop here.") | |
puts mountain | |
puts mountain.peak | |
puts mountain.timberline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment