Class: Interface
- Inherits:
-
Object
- Object
- Interface
- Defined in:
- lib/zapix/zabbix_classes/interface.rb
Instance Attribute Summary collapse
-
#dns ⇒ Object
readonly
Returns the value of attribute dns.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#main ⇒ Object
readonly
Returns the value of attribute main.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#useip ⇒ Object
readonly
Returns the value of attribute useip.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Interface
constructor
for more info see www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions#host_interface we assume ip and dns shall always be set.
- #to_hash ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Interface
for more info see
https://www.zabbix.com/documentation/2.0/manual/appendix/api/hostinterface/definitions#host_interface
we assume ip and dns shall always be set
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 8 def initialize(attributes) @type = attributes['type'] ||= 1 @main = attributes['main'] ||= 1 @useip = attributes['useip'] ||= 1 @ip = attributes['ip'] = attributes['ip'] @dns = attributes['dns'] = attributes['dns'] @port = attributes['port'] = attributes['port'] ||= 10_050 @result = { 'type' => type, 'main' => main, 'useip' => useip, 'ip' => ip, 'dns' => dns, 'port' => port } end |
Instance Attribute Details
#dns ⇒ Object (readonly)
Returns the value of attribute dns.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def dns @dns end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def ip @ip end |
#main ⇒ Object (readonly)
Returns the value of attribute main.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def main @main end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def port @port end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def type @type end |
#useip ⇒ Object (readonly)
Returns the value of attribute useip.
2 3 4 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 2 def useip @useip end |
Instance Method Details
#to_hash ⇒ Object
25 26 27 |
# File 'lib/zapix/zabbix_classes/interface.rb', line 25 def to_hash @result end |