Class: CSstats::Client
- Inherits:
-
Object
- Object
- CSstats::Client
- Defined in:
- lib/csstats/client.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#max_players ⇒ Object
readonly
Returns the value of attribute max_players.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Public: Initialize file.
- #players ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Public: Initialize file.
options - The Hash options:
:path - The String of csstats.dat file path (required).
:max_players - The Integer of how many players to return (optional).
Returns nothing.
14 15 16 17 18 19 |
# File 'lib/csstats/client.rb', line 14 def initialize( = {}) @file_path = [:path] @max_players = [:max_players] || 0 raise CSstats::FileNotExist unless File.exist?(file_path.to_s) end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
5 6 7 |
# File 'lib/csstats/client.rb', line 5 def file_path @file_path end |
#max_players ⇒ Object (readonly)
Returns the value of attribute max_players.
5 6 7 |
# File 'lib/csstats/client.rb', line 5 def max_players @max_players end |