Class: RiotKit::Models::Riot::Player
- Inherits:
-
Object
- Object
- RiotKit::Models::Riot::Player
- Extended by:
- Forwardable
- Defined in:
- lib/riot_kit/models/riot/player.rb,
lib/riot_kit/models/riot/player/stats.rb,
lib/riot_kit/models/riot/player/combat.rb,
lib/riot_kit/models/riot/player/vision.rb,
lib/riot_kit/models/riot/player/economy.rb,
lib/riot_kit/models/riot/player/equipment.rb,
lib/riot_kit/models/riot/player/objectives.rb
Defined Under Namespace
Classes: Combat, Economy, Equipment, Objectives, Stats, Vision
Instance Attribute Summary collapse
-
#champ_level ⇒ Object
readonly
Returns the value of attribute champ_level.
-
#champion_id ⇒ Object
readonly
Returns the value of attribute champion_id.
-
#champion_name ⇒ Object
readonly
Returns the value of attribute champion_name.
-
#combat ⇒ Object
readonly
Returns the value of attribute combat.
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#economy ⇒ Object
readonly
Returns the value of attribute economy.
-
#equipment ⇒ Object
readonly
Returns the value of attribute equipment.
-
#lane ⇒ Object
readonly
Returns the value of attribute lane.
-
#objectives ⇒ Object
readonly
Returns the value of attribute objectives.
-
#riot_id_game_name ⇒ Object
readonly
Returns the value of attribute riot_id_game_name.
-
#riot_id_tagline ⇒ Object
readonly
Returns the value of attribute riot_id_tagline.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
-
#summoner_name ⇒ Object
readonly
Returns the value of attribute summoner_name.
-
#team_id ⇒ Object
readonly
Returns the value of attribute team_id.
-
#team_position ⇒ Object
readonly
Returns the value of attribute team_position.
-
#vision ⇒ Object
readonly
Returns the value of attribute vision.
-
#win ⇒ Object
readonly
Returns the value of attribute win.
Instance Method Summary collapse
- #display_riot_id ⇒ Object
-
#initialize(**attrs) ⇒ Player
constructor
A new instance of Player.
- #to_h ⇒ Object
Constructor Details
#initialize(**attrs) ⇒ Player
Returns a new instance of Player.
52 53 54 55 56 57 58 59 60 |
# File 'lib/riot_kit/models/riot/player.rb', line 52 def initialize(**attrs) assign_identity(attrs) @stats = Player::Stats.new(**attrs) @combat = Player::Combat.new(**attrs) @economy = Player::Economy.new(**attrs) @vision = Player::Vision.new(**attrs) @objectives = Player::Objectives.new(**attrs) @equipment = Player::Equipment.new(**attrs) end |
Instance Attribute Details
#champ_level ⇒ Object (readonly)
Returns the value of attribute champ_level.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def champ_level @champ_level end |
#champion_id ⇒ Object (readonly)
Returns the value of attribute champion_id.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def champion_id @champion_id end |
#champion_name ⇒ Object (readonly)
Returns the value of attribute champion_name.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def champion_name @champion_name end |
#combat ⇒ Object (readonly)
Returns the value of attribute combat.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def combat @combat end |
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def current_user @current_user end |
#economy ⇒ Object (readonly)
Returns the value of attribute economy.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def economy @economy end |
#equipment ⇒ Object (readonly)
Returns the value of attribute equipment.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def equipment @equipment end |
#lane ⇒ Object (readonly)
Returns the value of attribute lane.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def lane @lane end |
#objectives ⇒ Object (readonly)
Returns the value of attribute objectives.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def objectives @objectives end |
#riot_id_game_name ⇒ Object (readonly)
Returns the value of attribute riot_id_game_name.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def riot_id_game_name @riot_id_game_name end |
#riot_id_tagline ⇒ Object (readonly)
Returns the value of attribute riot_id_tagline.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def riot_id_tagline @riot_id_tagline end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def role @role end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def stats @stats end |
#summoner_name ⇒ Object (readonly)
Returns the value of attribute summoner_name.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def summoner_name @summoner_name end |
#team_id ⇒ Object (readonly)
Returns the value of attribute team_id.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def team_id @team_id end |
#team_position ⇒ Object (readonly)
Returns the value of attribute team_position.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def team_position @team_position end |
#vision ⇒ Object (readonly)
Returns the value of attribute vision.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def vision @vision end |
#win ⇒ Object (readonly)
Returns the value of attribute win.
18 19 20 |
# File 'lib/riot_kit/models/riot/player.rb', line 18 def win @win end |
Instance Method Details
#display_riot_id ⇒ Object
62 63 64 65 66 |
# File 'lib/riot_kit/models/riot/player.rb', line 62 def display_riot_id return riot_id_game_name if riot_id_tagline.to_s.strip.empty? "#{riot_id_game_name}##{riot_id_tagline}" end |
#to_h ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/riot_kit/models/riot/player.rb', line 68 def to_h identity_to_h .merge(stats.to_h) .merge(combat.to_h) .merge(economy.to_h) .merge(vision.to_h) .merge(objectives.to_h) .merge(equipment.to_h) end |