Class: OvirtSDK4::Bonding

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

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (Bonding) initialize(opts = {})

Creates a new instance of the OvirtSDK4::Bonding 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):

  • :options (Array<Option>, Array<Hash>)

    The values of attribute options.

  • :slaves (Array<HostNic>, Array<Hash>)

    The values of attribute slaves.



1194
1195
1196
1197
1198
# File 'lib/ovirtsdk4/types.rb', line 1194

def initialize(opts = {})
  super(opts)
  self.options = opts[:options]
  self.slaves = opts[:slaves]
end

Instance Method Details

- (Array<Option>) options

Returns the value of the options attribute.

Returns:



1137
1138
1139
# File 'lib/ovirtsdk4/types.rb', line 1137

def options
  return @options
end

- (Object) options=(list)

Sets the value of the options attribute.

Parameters:



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
# File 'lib/ovirtsdk4/types.rb', line 1145

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

- (Array<HostNic>) slaves

Returns the value of the slaves attribute.

Returns:



1162
1163
1164
# File 'lib/ovirtsdk4/types.rb', line 1162

def slaves
  return @slaves
end

- (Object) slaves=(list)

Sets the value of the slaves attribute.

Parameters:



1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
# File 'lib/ovirtsdk4/types.rb', line 1170

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