Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
class Person attr_accessor :name def greeting "Hello I'm #{@name}" end end class Doctor < Person attr_accessor :type def specialty "My specialty is in #{@type}" end end person = Person.new person.name = "Johnny" puts person.greeting doctor = Doctor.new doctor.name = "John" #use inherited attribute doctor.type = "Family Doctor" puts doctor.greeting #use inherited method puts doctor.specialty
From the Design Piracy series on my blog: