Class: Rito::Champion

Inherits:
ApiBase show all
Defined in:
lib/rito/champion.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from ApiBase

#attributes=, call_api, from_list, from_map, from_map_of_lists, #initialize

Constructor Details

This class inherits a constructor from Rito::ApiBase

Instance Attribute Details

#activeObject

Returns the value of attribute active


3
4
5
# File 'lib/rito/champion.rb', line 3

def active
  @active
end

#botEnabledObject

Returns the value of attribute botEnabled


3
4
5
# File 'lib/rito/champion.rb', line 3

def botEnabled
  @botEnabled
end

#botMmEnabledObject

Returns the value of attribute botMmEnabled


3
4
5
# File 'lib/rito/champion.rb', line 3

def botMmEnabled
  @botMmEnabled
end

#freeToPlayObject

Returns the value of attribute freeToPlay


3
4
5
# File 'lib/rito/champion.rb', line 3

def freeToPlay
  @freeToPlay
end

#idObject

Returns the value of attribute id


3
4
5
# File 'lib/rito/champion.rb', line 3

def id
  @id
end

#rankedPlayEnabledObject

Returns the value of attribute rankedPlayEnabled


3
4
5
# File 'lib/rito/champion.rb', line 3

def rankedPlayEnabled
  @rankedPlayEnabled
end

Class Method Details

.allObject


11
12
13
14
15
# File 'lib/rito/champion.rb', line 11

def all
  url = champion_url
  response = call_api(url)
  from_list(response['champions'])
end

.by_id(id) ⇒ Object


24
25
26
27
28
# File 'lib/rito/champion.rb', line 24

def by_id(id)
  url = champion_url + "/#{id}"
  response = call_api(url)
  new(response)
end

.freeObject


17
18
19
20
21
22
# File 'lib/rito/champion.rb', line 17

def free
  params = { 'freeToPlay' => true }
  url = champion_url
  response = call_api(url, params)
  from_list(response['champions'])
end