Skip to content

Instantly share code, notes, and snippets.

@skylar
Last active August 29, 2015 14:20
Show Gist options
  • Select an option

  • Save skylar/80784252303bd2581772 to your computer and use it in GitHub Desktop.

Select an option

Save skylar/80784252303bd2581772 to your computer and use it in GitHub Desktop.
account number - short circuit status
class ApiOutputMarshal::MassPay
attr_reader :mass_pay
def initalize(mass_pay)
@mass_pay = mass_pay
end
def status
last_two = mass_pay.bank_account.account_number[-2..-1].to_i
if (0..5).member?(last_two)
last_two
else
mass_pay.status_code
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment