class SleeperRb::Resources::League::Transaction

Represents a waiver move, free agent transaction, or trade.

Attributes

adds[R]
consenter_ids[R]
created[R]
creator[R]
drops[R]
roster_ids[R]
status[R]
status_updated[R]
transaction_id[R]
type[R]
week[R]

Public Instance Methods

consenting_rosters() click to toggle source

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
draft_picks() click to toggle source

Any draft picks traded as part of this transaction.

@return [SleeperRb::Resources::TradedPickArray]

# File lib/sleeper_rb/resources/league/transaction.rb, line 71
        
faab?() click to toggle source

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
free_agent?() click to toggle source

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
metadata() click to toggle source

@return [SleeperRb::Resources::League::Transaction::Metadata]

# File lib/sleeper_rb/resources/league/transaction.rb, line 61
        
rosters() click to toggle source

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
settings() click to toggle source

@return [SleeperRb::Resources::League::Transaction::Settings]

# File lib/sleeper_rb/resources/league/transaction.rb, line 56
        
trade?() click to toggle source

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
user() click to toggle source

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
waiver?() click to toggle source

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
waiver_budget() click to toggle source

@return [Array<SleeperRb::Resources::League::Transaction::WaiverBudget>]

# File lib/sleeper_rb/resources/league/transaction.rb, line 51