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.
103 104 105 |
# File 'lib/vipruby.rb', line 103 def initialize params = {} params.each { |key, value| send "#{key}=", value } end |
Instance Attribute Details
#discoverable ⇒ Object
Returns the value of attribute discoverable.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def discoverable @discoverable end |
#fqdn ⇒ Object
Returns the value of attribute fqdn.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def fqdn @fqdn end |
#initiator_node ⇒ Object
Returns the value of attribute initiator_node.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def initiator_node @initiator_node end |
#initiators_port ⇒ Object
Returns the value of attribute initiators_port.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def initiators_port @initiators_port end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def ip_address @ip_address end |
#name ⇒ Object
Returns the value of attribute name.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def name @name end |
#protocol ⇒ Object
Returns the value of attribute protocol.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def protocol @protocol end |
#type ⇒ Object
Returns the value of attribute type.
101 102 103 |
# File 'lib/vipruby.rb', line 101 def type @type end |
Instance Method Details
#generate_initiators_json ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/vipruby.rb', line 116 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
107 108 109 110 111 112 113 114 |
# File 'lib/vipruby.rb', line 107 def generate_json { type: @type.capitalize, name: @name, host_name: @fqdn, discoverable: @discoverable.downcase }.to_json end |