Skip to content

Instantly share code, notes, and snippets.

@joshuaclayton
Created October 9, 2008 20:51
Show Gist options
  • Save joshuaclayton/15884 to your computer and use it in GitHub Desktop.
Save joshuaclayton/15884 to your computer and use it in GitHub Desktop.
>> class Person
>> def age
>> self.calculate_age
>> end
>>
?> def calculate_age
>> 'age from person'
>> end
>> end
=> nil
>>
?> class Joe < Person
>> def calculate_age
>> 'age of Joe'
>> end
>> end
=> nil
>> j = Joe.new
=> #<Joe:0x257a9c>
>> j.age
=> "age of Joe"
>> p = Person.new
=> #<Person:0x252b14>
>> p.calculate_age
=> "age from person"
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment