Skip to content

Instantly share code, notes, and snippets.

@janjiss
Created December 14, 2015 14:07
Show Gist options
  • Save janjiss/dd9f1cd30f856ec107ea to your computer and use it in GitHub Desktop.
Save janjiss/dd9f1cd30f856ec107ea to your computer and use it in GitHub Desktop.
class Notifier
class << self
def build(input)
new(
input,
Parser.new,
Gateway.new
)
end
end
def initialize(input, parser, gateway)
@input = input
@parser = parser
@gateway = gateway
end
def call
parsed_input = parser.parse(input)
gateway.call(parsed_input)
end
attr_reader :parser, :gateway, :input
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment