Skip to content

Instantly share code, notes, and snippets.

@tyrotinal
Created May 19, 2013 00:54
Show Gist options
  • Save tyrotinal/5606251 to your computer and use it in GitHub Desktop.
Save tyrotinal/5606251 to your computer and use it in GitHub Desktop.
ruby: 1 - simple class Car
class Car
def initialize (gas,mile)
@gas = gas
@mile = mile
end
def get_gas
return @gas
end
def get_mile
return @mile
end
def set_gas=(newgas)
@gas = newgas
end
def set_mile=(newmile)
@mile = newmile
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment