Skip to content

Instantly share code, notes, and snippets.

@ellismarte
Last active July 21, 2016 20: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 ellismarte/f3928fd60f49b09158debae88b70d220 to your computer and use it in GitHub Desktop.
Save ellismarte/f3928fd60f49b09158debae88b70d220 to your computer and use it in GitHub Desktop.
def publish_for_retry(message, last_resort)
if message["retry_count_not_exceeded"]
puts publish(message["body"])
else
puts send(last_resort, message["body"])
end
end
def publish(message)
message
end
def say(something)
something + "last_resort"
end
publish_for_retry({"retry_count_not_exceeded" => 1 > 2, "body" => "snakes"}, :say)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment