Class: Leagues
- Inherits:
-
Object
- Object
- Leagues
- Defined in:
- lib/LoLStat/Leagues.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(summonerId, api_key) ⇒ Leagues
constructor
A new instance of Leagues.
Constructor Details
#initialize(summonerId, api_key) ⇒ Leagues
Returns a new instance of Leagues.
3 4 5 6 |
# File 'lib/LoLStat/Leagues.rb', line 3 def initialize(summonerId, api_key) @URI = "https://prod.api.pvp.net/api/na/v2.1/league/by-summoner/" + summonerId.to_s + "?api_key=" + api_key.to_s @data = JSON.parse(Net::HTTP.get_response(URI.parse(@URI)).body) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
2 3 4 |
# File 'lib/LoLStat/Leagues.rb', line 2 def data @data end |