Class: HonStats::Classes::Server

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (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

#ipObject (readonly)

Returns the value of attribute ip.



7
8
9
# File 'lib/honstats/server.rb', line 7

def ip
  @ip
end

#portObject (readonly)

Returns the value of attribute port.



7
8
9
# File 'lib/honstats/server.rb', line 7

def port
  @port
end

#sessionObject (readonly)

Returns the value of attribute session.



7
8
9
# File 'lib/honstats/server.rb', line 7

def session
  @session
end