Class: OvirtSDK4::Dns

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ Dns

Creates a new instance of the OvirtSDK4::Dns class.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :search_domains (Array<Host>, Array<Hash>)

    The values of attribute search_domains.

  • :servers (Array<Host>, Array<Hash>)

    The values of attribute servers.



3204
3205
3206
3207
3208
# File 'lib/ovirtsdk4/types.rb', line 3204

def initialize(opts = {})
  super(opts)
  self.search_domains = opts[:search_domains]
  self.servers = opts[:servers]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



3213
3214
3215
3216
3217
# File 'lib/ovirtsdk4/types.rb', line 3213

def ==(other)
  super &&
  @search_domains == other.search_domains &&
  @servers == other.servers
end

#hashObject

Generates a hash value for this object.



3222
3223
3224
3225
3226
# File 'lib/ovirtsdk4/types.rb', line 3222

def hash
  super +
  @search_domains.hash +
  @servers.hash
end

#search_domainsArray<Host>

Returns the value of the search_domains attribute.

Returns:



3145
3146
3147
# File 'lib/ovirtsdk4/types.rb', line 3145

def search_domains
  @search_domains
end

#search_domains=(list) ⇒ Object

Sets the value of the search_domains attribute.

Parameters:

  • list (Array<Host>)


3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
# File 'lib/ovirtsdk4/types.rb', line 3154

def search_domains=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Host.new(value)
      end
    end
  end
  @search_domains = list
end

#serversArray<Host>

Returns the value of the servers attribute.

Returns:



3171
3172
3173
# File 'lib/ovirtsdk4/types.rb', line 3171

def servers
  @servers
end

#servers=(list) ⇒ Object

Sets the value of the servers attribute.

Parameters:

  • list (Array<Host>)


3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
# File 'lib/ovirtsdk4/types.rb', line 3180

def servers=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Host.new(value)
      end
    end
  end
  @servers = list
end