Class: Infoblox::Host

Inherits:
Resource show all
Defined in:
lib/infoblox/resource/host.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#_ref, #connection

Instance Method Summary collapse

Methods inherited from Resource

_return_fields, all, default_params, #delete, find, #get, #initialize, #post, #put, remote_attr_accessor, remote_attr_writer, remote_attrs, remote_post_accessor, remote_post_attrs, remote_write_only_attrs, resource_uri, #resource_uri, wapi_object

Constructor Details

This class inherits a constructor from Infoblox::Resource

Instance Attribute Details

#viewObject

Returns the value of attribute view.



5
6
7
# File 'lib/infoblox/resource/host.rb', line 5

def view
  @view
end

Instance Method Details

#add_ipv4addr(address) ⇒ Object



15
16
17
# File 'lib/infoblox/resource/host.rb', line 15

def add_ipv4addr(address)
  ipv4addrs << Ipv4addr.new(:ipv4addr => address)
end

#ipv4addrsObject



19
20
21
# File 'lib/infoblox/resource/host.rb', line 19

def ipv4addrs
  @ipv4addrs ||= []
end

#ipv4addrs=(attrs = []) ⇒ Object



9
10
11
12
13
# File 'lib/infoblox/resource/host.rb', line 9

def ipv4addrs=(attrs=[])
  attrs.each do |att|
    ipv4addrs << Ipv4addr.new(att)
  end
end

#remote_attribute_hash(write = false, post = false) ⇒ Object



23
24
25
26
27
# File 'lib/infoblox/resource/host.rb', line 23

def remote_attribute_hash(write=false, post=false)
  super.tap do |hsh|
    hsh[:ipv4addrs] = ipv4addrs.map{|i| {:ipv4addr => i.ipv4addr}}
  end
end