class EspnFflApi::Team

Attributes

abbrev[R]
id[R]
logo_url[R]
losses[R]
owners_uuids[R]
points_against[R]
points_for[R]
team_name[R]
ties[R]
wins[R]

Public Class Methods

build(team_hash) click to toggle source
# File lib/espn_ffl_api/team.rb, line 18
def self.build(team_hash)
  new(
    id: team_hash["id"],
    team_name: "#{team_hash["location"]} #{team_hash["nickname"]}",
    owners_uuids: team_hash["owners"],
    abbrev: team_hash["abbrev"],
    logo_url: team_hash["logo"],
    points_for: team_hash["record"]["overall"]["pointsFor"],
    points_against: team_hash["record"]["overall"]["pointsAgainst"],
    wins: team_hash["record"]["overall"]["wins"],
    losses: team_hash["record"]["overall"]["losses"],
    ties: team_hash["record"]["overall"]["ties"],
  )
end
new(id:, team_name:, owners_uuids:, abbrev:, logo_url:, points_for:, points_against:, wins:, losses:, ties:) click to toggle source
# File lib/espn_ffl_api/team.rb, line 5
def initialize(id:, team_name:, owners_uuids:, abbrev:, logo_url:, points_for:, points_against:, wins:, losses:, ties:)
  @id = id
  @team_name = team_name
  @owners_uuids = owners_uuids
  @abbrev = abbrev
  @logo_url = logo_url
  @points_for = points_for
  @points_against = points_against
  @wins = wins
  @losses = losses
  @ties = ties
end