Skip to content

Instantly share code, notes, and snippets.

@Sihui
Last active October 11, 2017 23:09
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 Sihui/b8a665bb7e3151216c0544491280c5ca to your computer and use it in GitHub Desktop.
Save Sihui/b8a665bb7e3151216c0544491280c5ca to your computer and use it in GitHub Desktop.
Design Pattern: Command and Hotel Service
class Concierge
attr_reader :request_list
def initialize
@request_list = []
end
end
class We
def submit_request_to(concierge, request)
concierge.request_list << request
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment