Class: Hearthstone::Log::GamePlayer

Inherits:
Object
  • Object
show all
Defined in:
lib/hearthstone/log/data/game_player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil) ⇒ GamePlayer

Returns a new instance of GamePlayer.



7
8
9
10
11
# File 'lib/hearthstone/log/data/game_player.rb', line 7

def initialize(id: nil, name: nil)
  @name = name
  @id = id
  @first_player = false
end

Instance Attribute Details

#first_playerObject

Returns the value of attribute first_player.



4
5
6
# File 'lib/hearthstone/log/data/game_player.rb', line 4

def first_player
  @first_player
end

#heroObject

Returns the value of attribute hero.



5
6
7
# File 'lib/hearthstone/log/data/game_player.rb', line 5

def hero
  @hero
end

#hero_powerObject

Returns the value of attribute hero_power.



5
6
7
# File 'lib/hearthstone/log/data/game_player.rb', line 5

def hero_power
  @hero_power
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/hearthstone/log/data/game_player.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/hearthstone/log/data/game_player.rb', line 4

def name
  @name
end

Instance Method Details

#to_hashObject



13
14
15
16
17
18
19
20
21
# File 'lib/hearthstone/log/data/game_player.rb', line 13

def to_hash
  {
    id: id, 
    name: name, 
    first_player: first_player, 
    hero: hero,
    hero_power: hero_power
  }
end