Skip to content

Instantly share code, notes, and snippets.

@gmcinnes
Created September 8, 2014 15:28
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 gmcinnes/32ee7c24b3ee6b36067a to your computer and use it in GitHub Desktop.
Save gmcinnes/32ee7c24b3ee6b36067a to your computer and use it in GitHub Desktop.
Delegation
class Car
def init(type_of_car)
@engine = EngineFactory.new(type_of_car)
end
def start
@engine.start
end
def stop
@engine.stop
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment