Class: Netscaler::VServer::ServiceInfo
- Inherits:
-
Object
- Object
- Netscaler::VServer::ServiceInfo
- Defined in:
- lib/netscaler/vserver/response.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#name ⇒ Object
Returns the value of attribute name.
-
#state ⇒ Object
Returns the value of attribute state.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(raw_response, index) ⇒ ServiceInfo
constructor
A new instance of ServiceInfo.
- #port ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(raw_response, index) ⇒ ServiceInfo
Returns a new instance of ServiceInfo.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/netscaler/vserver/response.rb', line 86 def initialize(raw_response, index) @name = raw_response[:servicename][:item] @ip_address = raw_response[:svcipaddress][:item] @state = raw_response[:svcstate][:item] @port = raw_response[:svcport][:item] @type = raw_response[:svctype][:item] if !index.nil? @name = @name[index] @ip_address = @ip_address[index] @state = @state[index] @port = @port[index] @type = @type[index] end end |
Instance Attribute Details
#ip_address ⇒ Object
Returns the value of attribute ip_address.
84 85 86 |
# File 'lib/netscaler/vserver/response.rb', line 84 def ip_address @ip_address end |
#name ⇒ Object
Returns the value of attribute name.
84 85 86 |
# File 'lib/netscaler/vserver/response.rb', line 84 def name @name end |
#state ⇒ Object
Returns the value of attribute state.
84 85 86 |
# File 'lib/netscaler/vserver/response.rb', line 84 def state @state end |
#type ⇒ Object
Returns the value of attribute type.
84 85 86 |
# File 'lib/netscaler/vserver/response.rb', line 84 def type @type end |
Instance Method Details
#port ⇒ Object
102 103 104 |
# File 'lib/netscaler/vserver/response.rb', line 102 def port @port.to_i end |
#to_hash ⇒ Object
106 107 108 109 110 111 112 113 |
# File 'lib/netscaler/vserver/response.rb', line 106 def to_hash { :name => name, :ip_address => ip_address, :state => state, :port => port, :type => type } end |