Created
November 17, 2015 14:49
-
-
Save rivant/16418ddbdd78d755de9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New: | |
class BaseNotifier | |
def initialize(attributes={}) | |
@client_ip, @ec2_instance_id, @environment, @hl7_message, | |
@hl7_response, @queue_response, @stats, @title = %i( | |
client_ip ec2_instance_id environment hl7_message | |
hl7_response queue_response stats title | |
).map do |key| | |
attributes.fetch(key, '') | |
end | |
@pass = attributes.fetch(:pass, false) | |
end | |
Original: | |
class BaseNotifier | |
def initialize(data) | |
@client_ip = data.fetch(:client_ip, '') | |
@ec2_instance_id = data.fetch(:ec2_instance_id, '') | |
@environment = data.fetch(:environment, '') | |
@hl7_message = data.fetch(:hl7_message, '') | |
@hl7_response = data.fetch(:hl7_response, '') | |
@pass = data.fetch(:pass, false) | |
@queue_response = data.fetch(:queue_response, '') | |
@stats = data.fetch(:stats, '') | |
@title = data.fetch(:title, '') | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment