class SleeperRb::Resources::League::Transaction
Represents a waiver move, free agent transaction, or trade.
Attributes
Public Instance Methods
Returns the rosters who consented to this transaction.
@return [SleeperRb::Resources::League::RosterArray
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 115 cached_association :consenting_rosters do league.rosters.where(roster_id: { in: consenter_ids }) end
Any draft picks traded as part of this transaction.
@return [SleeperRb::Resources::TradedPickArray
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 71
Returns true if the transaction is for a free agent acquired with FAAB.
@return [Boolean]
# File lib/sleeper_rb/resources/league/transaction.rb, line 139 def faab? free_agent? && !waiver_bid.nil? end
Returns true if the transaction is for a free agent.
@return [Boolean]
# File lib/sleeper_rb/resources/league/transaction.rb, line 131 def free_agent? type == "free_agent" end
@return [SleeperRb::Resources::League::Transaction::Metadata
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 61
Returns rosters participating in this transaction.
@return [SleeperRb::Resources::League::RosterArray
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 97 cached_association :rosters do league.rosters.where(roster_id: { in: roster_ids }) end
@return [SleeperRb::Resources::League::Transaction::Settings
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 56
Returns true if the transaction is a trade.
@return [Boolean]
# File lib/sleeper_rb/resources/league/transaction.rb, line 123 def trade? type == "trade" end
Returns the User
who created this transaction.
@return [SleeperRb::Resources::User
]
# File lib/sleeper_rb/resources/league/transaction.rb, line 106 cached_association :user do league.users.detect { |user| user.user_id == creator } end
Returns true if the transaction is for a free agent acquired via the waiver wire.
@return [Boolean]
# File lib/sleeper_rb/resources/league/transaction.rb, line 147 def waiver? free_agent? && !waiver_bid end
@return [Array<SleeperRb::Resources::League::Transaction::WaiverBudget
>]
# File lib/sleeper_rb/resources/league/transaction.rb, line 51