Created
February 21, 2017 16:16
-
-
Save tansengming/09be8c07c57e29946d2cb0a229b29886 to your computer and use it in GitHub Desktop.
This file contains 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
# Job 1 | |
sms_credits = community.sms_credits # start with 100 credits | |
if sms_credits > 0 | |
send_sms recipient, message | |
# take off a credit | |
community.sms_credits = sms_credits - 1 | |
community.save # 99 credits | |
end | |
# Switch! ------------------------------------------------------------------- | |
# Job 2 | |
sms_credits = community.sms_credits # 99 credits | |
if sms_credits > 0 | |
send_sms recipient, message | |
# take off a credit | |
community.sms_credits = sms_credits - 1 | |
community.save # 98 credits | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment