Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class Computer
def turn_on; end
def type; end
def replace_cpu; end
def change_user_password; end
end
class ComputerUser
def initialize
@computer = Computer.new
end
end
class Programmer < ComputerUser
def write_code
@computer.turn_on
@computer.type
end
end
class Administrator < ComputerUser
def update_user
@computer.turn_on
@computer.change_user_password
end
end
class Technician < ComputerUser
def fix_computer
@computer.replace_cpu
@computer.turn_on
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.