Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'forwardable'
- class Robot
- end
- class Action
- def self.speak
- puts "beep beep beep"
- end
- end
- robot = Robot.new
- robot.extend SingleForwardable
- robot.def_delegator :Action, :speak, :robot_talk
- robot.robot_talk
Add Comment
Please, Sign In to add comment