Class: Player
- Inherits:
-
Object
- Object
- Player
- Defined in:
- lib/arkrb/server/player.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#player_id ⇒ Object
readonly
Returns the value of attribute player_id.
-
#steam_id ⇒ Object
readonly
Returns the value of attribute steam_id.
Instance Method Summary collapse
-
#initialize(name, steam_id, player_id) ⇒ Player
constructor
A new instance of Player.
- #to_h ⇒ Object (also: #to_hash)
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/arkrb/server/player.rb', line 8 def name @name end |
#player_id ⇒ Object (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_id ⇒ Object (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_h ⇒ Object 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 |