Class: Netscaler::Service::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/netscaler/service/response.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw_response) ⇒ Response

Returns a new instance of Response.



3
4
5
# File 'lib/netscaler/service/response.rb', line 3

def initialize(raw_response)
  @info = raw_response[:return][:list][:item]
end

Instance Method Details

#ip_addressObject



11
12
13
# File 'lib/netscaler/service/response.rb', line 11

def ip_address
  @info[:ipaddress]
end

#nameObject



7
8
9
# File 'lib/netscaler/service/response.rb', line 7

def name
  @info[:name]
end

#portObject



19
20
21
# File 'lib/netscaler/service/response.rb', line 19

def port
  @info[:port].to_i
end

#serverObject



23
24
25
# File 'lib/netscaler/service/response.rb', line 23

def server
  @info[:servername]
end

#stateObject



15
16
17
# File 'lib/netscaler/service/response.rb', line 15

def state
  @info[:svrstate]
end

#to_hashObject



27
28
29
30
31
32
33
34
# File 'lib/netscaler/service/response.rb', line 27

def to_hash
  { :name => name,
    :server => server,
    :ip_address => ip_address,
    :state => state,
    :port => port
  }
end