Class: LoL::Player

Inherits:
Resource show all
Defined in:
lib/captainteemo/player.rb

Constant Summary collapse

@@fields =
[
  :accountId,
  :summonerId,
  :name,
  :icon,
  :internalName,
  :level
]

Class Method Summary collapse

Methods inherited from Resource

endpoint_id, endpoints, has_resource, #initialize, search

Constructor Details

This class inherits a constructor from LoL::Resource

Class Method Details

.honor(platform, name, conditions = {}) ⇒ Object

Returns player commendation (internally Kudos).



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

def self.honor(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/honor")
  search.fetch_resource
end

.influence_points(platform, name, conditions = {}) ⇒ Object

Returns lifetime influence point gains for String Summoner on String Platform.



32
33
34
35
# File 'lib/captainteemo/player.rb', line 32

def self.influence_points(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/influence_points")
  search.fetch_resource
end

.ingame(platform, name, conditions = {}) ⇒ Object

Returns observer metadata and information if String Summoner on String Platform is playing a valid game.



20
21
22
23
# File 'lib/captainteemo/player.rb', line 20

def self.ingame(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/ingame")
  search.fetch_resource
end

.leagues(platform, name, conditions = {}) ⇒ Object

Returns Season 3 Leagues info (internally Pojo).



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

def self.leagues(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/leagues")
  search.fetch_resource
end

.mastery(platform, name, conditions = {}) ⇒ Object

Returns mastery pages for String Summoner on String Platform.



44
45
46
47
# File 'lib/captainteemo/player.rb', line 44

def self.mastery(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/mastery")
  search.fetch_resource
end

.recent_games(platform, name, conditions = {}) ⇒ Object

Returns last 10 matches (order is random) for String Summoner on String Platform.



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

def self.recent_games(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/recent_games")
  search.fetch_resource
end

.runes(platform, name, conditions = {}) ⇒ Object

Returns runepages for String Summoner on String Platform.



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

def self.runes(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/runes")
  search.fetch_resource
end

.teams(platform, name, conditions = {}) ⇒ Object

Returns all teams (and team match history) player is a member of.



56
57
58
59
# File 'lib/captainteemo/player.rb', line 56

def self.teams(platform, name, conditions={})
  search = LoL::Search.new("/#{self.endpoints[:singular]}/#{platform.to_s}/#{name}/teams")
  search.fetch_resource
end