Skip to content

Instantly share code, notes, and snippets.

@andyjeffries
Created June 19, 2009 11:32
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 andyjeffries/132564 to your computer and use it in GitHub Desktop.
Save andyjeffries/132564 to your computer and use it in GitHub Desktop.
class Vehicle
cattr_accessor :name
end
class Car < Vehicle
end
Car.name = "John"
#=> "John"
class Bike < Vehicle
end
>> Bike.name = "David"
#=> "David"
>> Car.name
#=> "David"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment