class LolesportsApi::Player

Constants

API_URL

Attributes

api_url[R]
bio[R]
contract_expiration[R]
first_name[R]
hometown[R]
id[R]
is_starter[R]
last_name[R]
name[R]
photo_url[R]
profile_url[R]
residency[R]
role[R]
role_id[R]
team_id[R]

Public Class Methods

all() click to toggle source
# File lib/lolesports-api/player.rb, line 29
def self.all
  fail StandardError, 'No API endpoint available.'
end
new(attributes = {}) click to toggle source
# File lib/lolesports-api/player.rb, line 10
def initialize(attributes = {})
  @id = attributes['id'] || attributes['playerId'].to_i
  @name = attributes['name']
  @bio = attributes['bio']
  @first_name = attributes['firstname']
  @last_name = attributes['lastName']
  @team_id = attributes['teamId']
  @role = attributes['role']
  @role_id = attributes['roleId']
  @is_starter = attributes['isStarter']
  @hometown = attributes['hometown']
  @photo_url = attributes['photoUrl']
  @profile_url = attributes['profileUrl']
  @residency = attributes['residency']

  @contract_expiration = parse_datetime(attributes['contractExpiration'])
  self
end