class OpenDoto::API::Player
Attributes
response[R]
Public Class Methods
new(response)
click to toggle source
# File lib/open_doto/api/player.rb, line 7 def initialize(response) @response = response end
Public Instance Methods
account_id()
click to toggle source
# File lib/open_doto/api/player.rb, line 15 def account_id profile['account_id'] end
avatar(size = nil)
click to toggle source
# File lib/open_doto/api/player.rb, line 19 def avatar(size = nil) avatar_for(size) end
cheese()
click to toggle source
# File lib/open_doto/api/player.rb, line 23 def cheese profile['cheese'] end
last_login_at()
click to toggle source
# File lib/open_doto/api/player.rb, line 27 def last_login_at profile['last_login'] end
location_country_code()
click to toggle source
# File lib/open_doto/api/player.rb, line 31 def location_country_code profile['loccountrycode'] end
name()
click to toggle source
# File lib/open_doto/api/player.rb, line 35 def name profile['name'] end
party_mmr()
click to toggle source
# File lib/open_doto/api/player.rb, line 39 def party_mmr response['competitive_rank'] end
persona_name()
click to toggle source
# File lib/open_doto/api/player.rb, line 43 def persona_name profile['personaname'] end
profile_url()
click to toggle source
# File lib/open_doto/api/player.rb, line 47 def profile_url profile['profileurl'] end
solo_mmr()
click to toggle source
# File lib/open_doto/api/player.rb, line 51 def solo_mmr response['solo_competitive_rank'] end
steam_id()
click to toggle source
# File lib/open_doto/api/player.rb, line 55 def steam_id profile['steamid'] end
untracked_at()
click to toggle source
# File lib/open_doto/api/player.rb, line 59 def untracked_at response['tracked_until'] end
valid?()
click to toggle source
# File lib/open_doto/api/player.rb, line 11 def valid? !account_id.nil? end
Private Instance Methods
avatar_for(size)
click to toggle source
# File lib/open_doto/api/player.rb, line 69 def avatar_for(size) case size when :medium profile['avatarmedium'] when :full profile['avatarfull'] else profile['avatar'] end end
profile()
click to toggle source
# File lib/open_doto/api/player.rb, line 65 def profile response['profile'] || {} end