Class: OpenDoto::API::Player
- Inherits:
-
Object
- Object
- OpenDoto::API::Player
- Defined in:
- lib/open_doto/api/player.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #account_id ⇒ Object
- #avatar(size = nil) ⇒ Object
- #cheese ⇒ Object
-
#initialize(response) ⇒ Player
constructor
A new instance of Player.
- #last_login_at ⇒ Object
- #location_country_code ⇒ Object
- #name ⇒ Object
- #party_mmr ⇒ Object
- #persona_name ⇒ Object
- #profile_url ⇒ Object
- #solo_mmr ⇒ Object
- #steam_id ⇒ Object
- #untracked_at ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ Player
Returns a new instance of Player.
7 8 9 |
# File 'lib/open_doto/api/player.rb', line 7 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/open_doto/api/player.rb', line 6 def response @response end |
Instance Method Details
#account_id ⇒ Object
15 16 17 |
# File 'lib/open_doto/api/player.rb', line 15 def account_id profile['account_id'] end |
#avatar(size = nil) ⇒ Object
19 20 21 |
# File 'lib/open_doto/api/player.rb', line 19 def avatar(size = nil) avatar_for(size) end |
#cheese ⇒ Object
23 24 25 |
# File 'lib/open_doto/api/player.rb', line 23 def cheese profile['cheese'] end |
#last_login_at ⇒ Object
27 28 29 |
# File 'lib/open_doto/api/player.rb', line 27 def last_login_at profile['last_login'] end |
#location_country_code ⇒ Object
31 32 33 |
# File 'lib/open_doto/api/player.rb', line 31 def location_country_code profile['loccountrycode'] end |
#name ⇒ Object
35 36 37 |
# File 'lib/open_doto/api/player.rb', line 35 def name profile['name'] end |
#party_mmr ⇒ Object
39 40 41 |
# File 'lib/open_doto/api/player.rb', line 39 def party_mmr response['competitive_rank'] end |
#persona_name ⇒ Object
43 44 45 |
# File 'lib/open_doto/api/player.rb', line 43 def persona_name profile['personaname'] end |
#profile_url ⇒ Object
47 48 49 |
# File 'lib/open_doto/api/player.rb', line 47 def profile_url profile['profileurl'] end |
#solo_mmr ⇒ Object
51 52 53 |
# File 'lib/open_doto/api/player.rb', line 51 def solo_mmr response['solo_competitive_rank'] end |
#steam_id ⇒ Object
55 56 57 |
# File 'lib/open_doto/api/player.rb', line 55 def steam_id profile['steamid'] end |
#untracked_at ⇒ Object
59 60 61 |
# File 'lib/open_doto/api/player.rb', line 59 def untracked_at response['tracked_until'] end |
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/open_doto/api/player.rb', line 11 def valid? !account_id.nil? end |