Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created June 14, 2012 19:42
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 practicingruby/2932464 to your computer and use it in GitHub Desktop.
Save practicingruby/2932464 to your computer and use it in GitHub Desktop.
module Person
attr_accessor :email, :first_name, :last_name
end
class Employee
include Person
attr_accessor :role
end
## Alternatively
class Person
attr_accessor :email, :first_name, :last_name
end
class Employee
def initialize(person)
self.person = person
self.role = role
end
attr_accessor :person, :role
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment