Class: LolReplay::Player

Inherits:
Object
  • Object
show all
Includes:
HashMethodAccessor
Defined in:
lib/lolreplay/player.rb

Instance Method Summary collapse

Methods included from HashMethodAccessor

#method_missing

Constructor Details

#initialize(data) ⇒ Player

Returns a new instance of Player.



7
8
9
# File 'lib/lolreplay/player.rb', line 7

def initialize data
  @data = data
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HashMethodAccessor

Instance Method Details

#leaver?Boolean

Alias for leaver

Returns:

  • (Boolean)


17
18
19
# File 'lib/lolreplay/player.rb', line 17

def leaver?
  @data[:leaver]
end

#nameObject

Alias for summoner



12
13
14
# File 'lib/lolreplay/player.rb', line 12

def name
  @data[:summoner]
end

#to_sObject



26
27
28
# File 'lib/lolreplay/player.rb', line 26

def to_s

end

#won?Boolean

Alias for won

Returns:

  • (Boolean)


22
23
24
# File 'lib/lolreplay/player.rb', line 22

def won?
  @data[:won]
end