Skip to content

Instantly share code, notes, and snippets.

@cannikin
Created December 15, 2008 21:05
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/36090 to your computer and use it in GitHub Desktop.
Save cannikin/36090 to your computer and use it in GitHub Desktop.
class Location
attr_reader :zip, :city, :state
def initialize(values={})
@zip = values[:zip]
@city = values[:city]
@state = values[:state]
end
def self.parse(text)
if text.is_a? Integer
return self.new({ :zip => text })
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment