Class: LOL::Api::CurrentGame

Inherits:
Object
  • Object
show all
Defined in:
lib/lol/api/current_game.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region:, summoner_id:) ⇒ CurrentGame

Returns a new instance of CurrentGame.



12
13
14
# File 'lib/lol/api/current_game.rb', line 12

def initialize(region:, summoner_id:)
  @region, @summoner_id = region, summoner_id
end

Instance Attribute Details

#regionObject

Returns the value of attribute region.



6
7
8
# File 'lib/lol/api/current_game.rb', line 6

def region
  @region
end

#summoner_idObject

Returns the value of attribute summoner_id.



6
7
8
# File 'lib/lol/api/current_game.rb', line 6

def summoner_id
  @summoner_id
end

Class Method Details

.call(region:, summoner_id:) ⇒ Object



8
9
10
# File 'lib/lol/api/current_game.rb', line 8

def self.call(region:, summoner_id:)
  new(region: region, summoner_id: summoner_id).data
end

Instance Method Details

#dataObject



16
17
18
# File 'lib/lol/api/current_game.rb', line 16

def data
  LOL::Api::Request.(endpoint)
end