Class: Brawlstars::Player
- Inherits:
-
Object
- Object
- Brawlstars::Player
show all
- Defined in:
- lib/brawlstars.rb
Instance Method Summary
collapse
Constructor Details
#initialize(client, data) ⇒ Player
Returns a new instance of Player.
186
187
188
189
|
# File 'lib/brawlstars.rb', line 186
def initialize(client, data)
@client = client
@data = data
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
191
192
193
194
195
196
197
|
# File 'lib/brawlstars.rb', line 191
def method_missing(name, *args, &block)
if @data.respond_to?(name)
@data.send(name, *args, &block)
else
super
end
end
|
Instance Method Details
#getBattleLog ⇒ Object
207
208
209
|
# File 'lib/brawlstars.rb', line 207
def getBattleLog
@client.getBattleLog(@data["tag"])
end
|
#getClub ⇒ Object
199
200
201
202
203
204
205
|
# File 'lib/brawlstars.rb', line 199
def getClub
if !@data["club"]
nil
else
@client.getClub(@data["club"]["tag"])
end
end
|
#to_s ⇒ Object
211
212
213
|
# File 'lib/brawlstars.rb', line 211
def to_s
"#{@data}"
end
|