active_bet 
The active bet that our app will create & use, handles following who owns the bet, who is betting, and also takes care of paying out at the end.
Vars | |
bet_owner | The person owning the bet, who will choose which option has won. |
---|---|
description | The description of the bet |
locked | Boolean on whether the bet is locked from getting new betters, or current ones from taking their money out. |
name | The name of the bet |
newscaster_message | The message we sent to the newscaster, which we'll then reply to once the betting is over. |
options | |
total_amount_bet | Total amount of money that has been bet. |
Procs | |
bet_money | Puts a bank account's money bet on a given option. |
cancel_bet | Cancels your bet, removing your bet and refunding your money. |
get_bets | Returns how many bets there is per option |
payout | Pays out the loser's money equally to all the winners, or refunds it all if no winning option was given. |
Var Details
bet_owner 
The person owning the bet, who will choose which option has won.
description 
The description of the bet
locked 
Boolean on whether the bet is locked from getting new betters, or current ones from taking their money out.
name 
The name of the bet
newscaster_message 
The message we sent to the newscaster, which we'll then reply to once the betting is over.
options 
- Assoc list of options, with each option having a list of people betting and the amount they've bet. options = list( OPTION_A = list( PERSON_1_ACCOUNT = bet_amount, PERSON_2_ACCOUNT = bet_amount, ), OPTION_B = list( PERSON_3_ACCOUNT = bet_amount, ), )
total_amount_bet 
Total amount of money that has been bet.
Proc Details
bet_money
Puts a bank account's money bet on a given option.
cancel_bet
Cancels your bet, removing your bet and refunding your money.
get_bets
Returns how many bets there is per option
payout
Pays out the loser's money equally to all the winners, or refunds it all if no winning option was given.