Class: Leader

Inherits:
Object
  • Object
show all
Defined in:
lib/api/utils/leader.rb

Overview

Leader class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Leader

Returns a new instance of Leader.



8
9
10
11
12
13
14
# File 'lib/api/utils/leader.rb', line 8

def initialize(data)
  @leader_board_rank = data['leaderboardRank']
  @ranked_rating = data['rankedRating']
  @number_of_wins = data['numberOfWins']
  @comptetitive_tier = data['competitiveTier']
  fetch_player_data(data)
end

Instance Attribute Details

#comptetitive_tierObject

Returns the value of attribute comptetitive_tier.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def comptetitive_tier
  @comptetitive_tier
end

#game_nameObject

Returns the value of attribute game_name.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def game_name
  @game_name
end

#is_anonymizedObject

Returns the value of attribute is_anonymized.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def is_anonymized
  @is_anonymized
end

#is_bannedObject

Returns the value of attribute is_banned.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def is_banned
  @is_banned
end

#leader_board_rankObject

Returns the value of attribute leader_board_rank.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def leader_board_rank
  @leader_board_rank
end

#number_of_winsObject

Returns the value of attribute number_of_wins.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def number_of_wins
  @number_of_wins
end

#player_card_idObject

Returns the value of attribute player_card_id.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def player_card_id
  @player_card_id
end

#puuidObject

Returns the value of attribute puuid.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def puuid
  @puuid
end

#ranked_ratingObject

Returns the value of attribute ranked_rating.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def ranked_rating
  @ranked_rating
end

#tag_lineObject

Returns the value of attribute tag_line.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def tag_line
  @tag_line
end

#title_idObject

Returns the value of attribute title_id.



5
6
7
# File 'lib/api/utils/leader.rb', line 5

def title_id
  @title_id
end

Instance Method Details

#fetch_player_data(data) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/api/utils/leader.rb', line 16

def fetch_player_data(data)
  @puuid = data['puuid']
  @game_name = data['gameName']
  @tag_line = data['tagLine']
  @player_card_id = data['PlayerCardID']
  @title_id = data['TitleID']
  @is_banned = data['IsBanned']
  @is_anonymized = data['IsAnonymized']
end