Created
May 19, 2013 00:54
-
-
Save tyrotinal/5606251 to your computer and use it in GitHub Desktop.
ruby: 1 - simple class Car
This file contains hidden or 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 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