Class: HonStats::Classes::Server
- Inherits:
-
Object
- Object
- HonStats::Classes::Server
- Defined in:
- lib/honstats/server.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
(also: #to_i)
readonly
Returns the value of attribute id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
-
#initialize(data) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(data) ⇒ Server
Returns a new instance of Server.
11 12 13 14 15 16 |
# File 'lib/honstats/server.rb', line 11 def initialize(data) @id = HonStats::API.get_data("server_id", data).to_i @session = HonStats::API.get_data("session", data).to_s @ip = HonStats::API.get_data("ip", data).to_s @port = HonStats::API.get_data("port", data).to_s end |
Instance Attribute Details
#id ⇒ Object (readonly) Also known as: to_i
Returns the value of attribute id.
7 8 9 |
# File 'lib/honstats/server.rb', line 7 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
7 8 9 |
# File 'lib/honstats/server.rb', line 7 def ip @ip end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
7 8 9 |
# File 'lib/honstats/server.rb', line 7 def port @port end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
7 8 9 |
# File 'lib/honstats/server.rb', line 7 def session @session end |