Class: Outrageous::Base
- Inherits:
-
Object
- Object
- Outrageous::Base
- Includes:
- HTTParty
- Defined in:
- lib/outrageous/base.rb
Constant Summary collapse
- CHAMPION_VERSION =
'v1.2'- GAME_VERSION =
'v1.3'- LEAGUE_VERSION =
'v2.3'- STATS_VERSION =
'v1.3'- STATIC_DATA_VERSION =
'v1'- SUMMONER_VERSION =
'v1.4'- TEAM_VERSION =
'v2.2'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#region ⇒ Object
Returns the value of attribute region.
-
#response ⇒ Object
Returns the value of attribute response.
-
#status ⇒ Object
Returns the value of attribute status.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #get(url, options = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(attributes = {}) ⇒ Base
Returns a new instance of Base.
21 22 23 24 25 |
# File 'lib/outrageous/base.rb', line 21 def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=", value) if respond_to?(name) end end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
19 20 21 |
# File 'lib/outrageous/base.rb', line 19 def api_key @api_key end |
#region ⇒ Object
Returns the value of attribute region.
19 20 21 |
# File 'lib/outrageous/base.rb', line 19 def region @region end |
#response ⇒ Object
Returns the value of attribute response.
19 20 21 |
# File 'lib/outrageous/base.rb', line 19 def response @response end |
#status ⇒ Object
Returns the value of attribute status.
19 20 21 |
# File 'lib/outrageous/base.rb', line 19 def status @status end |
#version ⇒ Object
Returns the value of attribute version.
19 20 21 |
# File 'lib/outrageous/base.rb', line 19 def version @version end |
Instance Method Details
#get(url, options = {}) ⇒ Object
31 32 33 34 35 |
# File 'lib/outrageous/base.rb', line 31 def get(url, = {}) response = self.class.get(url, query: { api_key: api_key }.merge()) self.status = response.code self.response = response.parsed_response end |