Class: Host
- Inherits:
-
Object
- Object
- Host
- Defined in:
- lib/vipruby.rb
Instance Attribute Summary collapse
-
#discoverable ⇒ Object
Returns the value of attribute discoverable.
-
#fqdn ⇒ Object
Returns the value of attribute fqdn.
-
#initiator_node ⇒ Object
Returns the value of attribute initiator_node.
-
#initiators_port ⇒ Object
Returns the value of attribute initiators_port.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#name ⇒ Object
Returns the value of attribute name.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #generate_initiators_json ⇒ Object
- #generate_json ⇒ Object
-
#initialize(params = {}) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(params = {}) ⇒ Host
Returns a new instance of Host.
402 403 404 |
# File 'lib/vipruby.rb', line 402 def initialize params = {} params.each { |key, value| send "#{key}=", value } end |
Instance Attribute Details
#discoverable ⇒ Object
Returns the value of attribute discoverable.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def discoverable @discoverable end |
#fqdn ⇒ Object
Returns the value of attribute fqdn.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def fqdn @fqdn end |
#initiator_node ⇒ Object
Returns the value of attribute initiator_node.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def initiator_node @initiator_node end |
#initiators_port ⇒ Object
Returns the value of attribute initiators_port.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def initiators_port @initiators_port end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def ip_address @ip_address end |
#name ⇒ Object
Returns the value of attribute name.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def name @name end |
#protocol ⇒ Object
Returns the value of attribute protocol.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def protocol @protocol end |
#type ⇒ Object
Returns the value of attribute type.
400 401 402 |
# File 'lib/vipruby.rb', line 400 def type @type end |
Instance Method Details
#generate_initiators_json ⇒ Object
415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/vipruby.rb', line 415 def generate_initiators_json initiator_json = [] @initiators_port.each do |initiator| initiator_json << { protocol: @protocol.upcase, initiator_port: initiator, initiator_node: @initiator_node }.to_json end initiator_json end |
#generate_json ⇒ Object
406 407 408 409 410 411 412 413 |
# File 'lib/vipruby.rb', line 406 def generate_json { type: @type.capitalize, name: @name, host_name: @fqdn, discoverable: @discoverable.downcase }.to_json end |