Class: Player

Inherits:
Object
  • Object
show all
Defined in:
lib/arkrb/server/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, steam_id, player_id) ⇒ Player

Returns a new instance of Player.



2
3
4
5
6
# File 'lib/arkrb/server/player.rb', line 2

def initialize(name, steam_id, player_id)
  @name = name
  @steam_id = steam_id
  @player_id = player_id
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/arkrb/server/player.rb', line 8

def name
  @name
end

#player_idObject (readonly)

Returns the value of attribute player_id.



8
9
10
# File 'lib/arkrb/server/player.rb', line 8

def player_id
  @player_id
end

#steam_idObject (readonly)

Returns the value of attribute steam_id.



8
9
10
# File 'lib/arkrb/server/player.rb', line 8

def steam_id
  @steam_id
end

Instance Method Details

#to_hObject Also known as: to_hash



10
11
12
13
14
15
16
# File 'lib/arkrb/server/player.rb', line 10

def to_h
  {
      name: name,
      steam_id: steam_id,
      player_id: player_id
  }
end