Created
August 14, 2008 10:46
-
-
Save arthurschreiber/5407 to your computer and use it in GitHub Desktop.
This file contains 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 Auto | |
def set_farbe(farbe) | |
@farbe = farbe | |
end | |
def farbe | |
@farbe | |
end | |
def beschreibung | |
"Ich habe die Farbe: #{self.farbe}" | |
end | |
end | |
rotes_auto = Auto.new | |
rotes_auto.set_farbe("Rot") | |
puts rotes_auto.beschreibung | |
blaues_auto = Auto.new | |
blaues_auto.set_farbe("Blau") | |
puts blaues_auto.beschreibung | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment