Created
August 26, 2016 22:40
-
-
Save danielpowell4/8a8cdbb8f9774da06847fdfc78b8c441 to your computer and use it in GitHub Desktop.
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 Mountain | |
attr_accessor :name, :height, :summit_attempts | |
def initialize(name, height) | |
@name = name | |
@height = height.to_s | |
@summit_attempts = 0 | |
end | |
def climb | |
summit_attempts += 1 | |
end | |
def talk | |
puts "I am #{name}" | |
puts "I am #{height}' tall" | |
puts "I have been climbed #{summit_attempts} times" | |
end | |
end | |
elbert = Mountain.new('Mt Elbert', 14433) | |
elbert.talk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment