class LolesportsApi::Team

Constants

API_URL

Attributes

acronym[R]
bio[R]
id[R]
logo_url[R]
losses[R]
name[R]
no_players[R]
profile_url[R]
roster[R]
team_photo_url[R]
wins[R]

Public Class Methods

find(team_id) click to toggle source
Calls superclass method LolesportsApi::BaseApiObject::find
# File lib/lolesports-api/team.rb, line 23
def self.find(team_id)
  super
  if @attributes['roster'].any?
    @attributes['roster'].each_value do |player|
      @base_object.roster << LolesportsApi::Player.new(player)
    end
  end
  @base_object
end
new(attributes = {}) click to toggle source
# File lib/lolesports-api/team.rb, line 9
def initialize(attributes = {})
  @id = attributes['id'].to_i
  @acronym = attributes['acronym']
  @bio = attributes['bio']
  @logo_url = attributes['logoUrl']
  @name = attributes['name']
  @no_players = attributes['noPlayers']
  @profile_url = attributes['profileUrl']
  @roster = []
  @team_photo_url = attributes['teamPhotoUrl']
  @losses = attributes['losses']
  @wins = attributes['wins']
end