Skip to content

Instantly share code, notes, and snippets.

@danielpowell4
Created August 26, 2016 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielpowell4/8a8cdbb8f9774da06847fdfc78b8c441 to your computer and use it in GitHub Desktop.
Save danielpowell4/8a8cdbb8f9774da06847fdfc78b8c441 to your computer and use it in GitHub Desktop.
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