Class: RMuh::ServerStats::Base
- Inherits:
-
Object
- Object
- RMuh::ServerStats::Base
- Defined in:
- lib/rmuh/serverstats/base.rb
Overview
TODO: Documentation
Constant Summary collapse
- DEFAULT_PORT =
2_302
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
- #stats ⇒ Object
- #update_cache ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 |
# File 'lib/rmuh/serverstats/base.rb', line 14 def initialize(opts = {}) fail ArgumentError, 'arg 1 must be a Hash' unless opts.is_a?(Hash) self.class.validate_opts(opts) opts_to_instance(opts) @gsq = GamespyQuery::Socket.new("#{@host}:#{@port}") end |
Instance Method Details
#stats ⇒ Object
21 22 23 |
# File 'lib/rmuh/serverstats/base.rb', line 21 def stats remote_stats end |
#update_cache ⇒ Object
25 26 27 |
# File 'lib/rmuh/serverstats/base.rb', line 25 def update_cache @serverstats = sync if @cache end |