Skip to content

Instantly share code, notes, and snippets.

@renius
Last active September 7, 2016 14:54
Show Gist options
  • Save renius/20ba50306b3a93516a2c0fb642409e17 to your computer and use it in GitHub Desktop.
Save renius/20ba50306b3a93516a2c0fb642409e17 to your computer and use it in GitHub Desktop.
HASH =
{
"U6" => { "RTC" => "RFC"},
else: { "MAN" => "TFD"}
}
def build_status_code(telegram)
carrier = telegram.info['CarrierCode']
status = telegram.info['StatusCode']
HASH.fetch(carrier, HASH.fetch(:else, status)).try(:[], status) || status
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment