Skip to content

Instantly share code, notes, and snippets.

@arthurschreiber
Created August 14, 2008 10:46
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 arthurschreiber/5407 to your computer and use it in GitHub Desktop.
Save arthurschreiber/5407 to your computer and use it in GitHub Desktop.
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