Skip to content

Instantly share code, notes, and snippets.

@cannikin
Created August 3, 2009 20:29
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 cannikin/160810 to your computer and use it in GitHub Desktop.
Save cannikin/160810 to your computer and use it in GitHub Desktop.
class Mountain
attr_reader :name, :latitude, :longitude
attr_accessor :country
def initialize(name, latitude, longitude)
@name, @latitude, @longitude = [name, latitude, longitude]
end
end
# Usage
k2 = Mountain.new('K2', 35.879314, 76.514283)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment