-
-
Save practicingruby/2932464 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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