Class: LolReplay::Player
- Inherits:
-
Object
- Object
- LolReplay::Player
- Includes:
- HashMethodAccessor
- Defined in:
- lib/lolreplay/player.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Player
constructor
A new instance of Player.
-
#leaver? ⇒ Boolean
Alias for leaver.
-
#name ⇒ Object
Alias for summoner.
- #to_s ⇒ Object
-
#won? ⇒ Boolean
Alias for won.
Methods included from HashMethodAccessor
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
17 18 19 |
# File 'lib/lolreplay/player.rb', line 17 def leaver? @data[:leaver] end |
#name ⇒ Object
Alias for summoner
12 13 14 |
# File 'lib/lolreplay/player.rb', line 12 def name @data[:summoner] end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/lolreplay/player.rb', line 26 def to_s end |
#won? ⇒ Boolean
Alias for won
22 23 24 |
# File 'lib/lolreplay/player.rb', line 22 def won? @data[:won] end |