Class: OpenDotaApi::Player

Inherits:
Entity
  • Object
show all
Defined in:
lib/open_dota_api/player.rb

Constant Summary collapse

ENDPOINT =
'players'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

define_adder, #initialize

Methods included from Entities::Instantiatable

included

Constructor Details

This class inherits a constructor from OpenDotaApi::Entity

Class Method Details

.instantiate(_ = nil) ⇒ Object

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/open_dota_api/player.rb', line 9

def self.instantiate(_ = nil)
  raise NotImplementedError
end

Instance Method Details

#account_idObject



22
23
24
# File 'lib/open_dota_api/player.rb', line 22

def 
  data&.dig('profile', 'account_id')
end

#avatarObject



38
39
40
# File 'lib/open_dota_api/player.rb', line 38

def avatar
  data&.dig('profile', 'avatar')
end

#avatar_fullObject



54
55
56
# File 'lib/open_dota_api/player.rb', line 54

def avatar_full
  data&.dig('profile', 'avatarfull')
end

#avatar_mediumObject



50
51
52
# File 'lib/open_dota_api/player.rb', line 50

def avatar_medium
  data&.dig('profile', 'avatarmedium')
end

#cheeseObject



34
35
36
# File 'lib/open_dota_api/player.rb', line 34

def cheese
  data&.dig('profile', 'cheese')
end

#contributor?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/open_dota_api/player.rb', line 42

def contributor?
  data&.dig('profile', 'is_contributor')
end

#last_loginObject



62
63
64
# File 'lib/open_dota_api/player.rb', line 62

def 
  Time.parse(data&.dig('profile', 'last_login'))
end

#loc_country_codeObject



66
67
68
# File 'lib/open_dota_api/player.rb', line 66

def loc_country_code
  data&.dig('profile', 'loccountrycode')
end

#mmr_estimateObject



13
14
15
# File 'lib/open_dota_api/player.rb', line 13

def mmr_estimate
  data&.dig('mmr_estimate', 'estimate')
end

#nameObject



26
27
28
# File 'lib/open_dota_api/player.rb', line 26

def name
  data&.dig('profile', 'name')
end

#persona_nameObject

profile section



18
19
20
# File 'lib/open_dota_api/player.rb', line 18

def persona_name
  data&.dig('profile', 'personaname')
end

#plusObject



30
31
32
# File 'lib/open_dota_api/player.rb', line 30

def plus
  data&.dig('profile', 'plus')
end

#profile_urlObject



58
59
60
# File 'lib/open_dota_api/player.rb', line 58

def profile_url
  data&.dig('profile', 'profileurl')
end

#steam_idObject



46
47
48
# File 'lib/open_dota_api/player.rb', line 46

def steam_id
  data&.dig('profile', 'steamid')
end