Class: Netscaler::ServiceGroup::ServerInfo
- Inherits:
-
Object
- Object
- Netscaler::ServiceGroup::ServerInfo
- Defined in:
- lib/netscaler/servicegroup/response.rb
Instance Attribute Summary collapse
-
#ip_address ⇒ Object
readonly
Returns the value of attribute ip_address.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(raw_response, index) ⇒ ServerInfo
constructor
A new instance of ServerInfo.
- #port ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(raw_response, index) ⇒ ServerInfo
Returns a new instance of ServerInfo.
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/netscaler/servicegroup/response.rb', line 52 def initialize(raw_response, index) @name = raw_response[:servername][:item] @ip_address = raw_response[:ipaddress][:item] @state = raw_response[:svcstate][:item] @port = raw_response[:port][:item] if !index.nil? @name = @name[index] @ip_address = @ip_address[index] @state = @state[index] @port = @port[index] end end |
Instance Attribute Details
#ip_address ⇒ Object (readonly)
Returns the value of attribute ip_address.
50 51 52 |
# File 'lib/netscaler/servicegroup/response.rb', line 50 def ip_address @ip_address end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
50 51 52 |
# File 'lib/netscaler/servicegroup/response.rb', line 50 def name @name end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
50 51 52 |
# File 'lib/netscaler/servicegroup/response.rb', line 50 def state @state end |
Instance Method Details
#port ⇒ Object
66 67 68 |
# File 'lib/netscaler/servicegroup/response.rb', line 66 def port @port.to_i end |
#to_hash ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/netscaler/servicegroup/response.rb', line 70 def to_hash { :name => name, :ip_address => ip_address, :state => state, :port => port } end |