Class: OvirtSDK4::VolumeGroup

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 = {}) ⇒ VolumeGroup

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

  • :id (String)

    The value of attribute id.

  • :logical_units (Array<LogicalUnit>, Array<Hash>)

    The values of attribute logical_units.

  • :name (String)

    The value of attribute name.


27245
27246
27247
27248
27249
27250
# File 'lib/ovirtsdk4/types.rb', line 27245

def initialize(opts = {})
  super(opts)
  self.id = opts[:id]
  self.logical_units = opts[:logical_units]
  self.name = opts[:name]
end

Instance Method Details

#==(other) ⇒ Object

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


27255
27256
27257
27258
27259
27260
# File 'lib/ovirtsdk4/types.rb', line 27255

def ==(other)
  super &&
  @id == other.id &&
  @logical_units == other.logical_units &&
  @name == other.name
end

#hashObject

Generates a hash value for this object.


27265
27266
27267
27268
27269
27270
# File 'lib/ovirtsdk4/types.rb', line 27265

def hash
  super +
  @id.hash +
  @logical_units.hash +
  @name.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

27174
27175
27176
# File 'lib/ovirtsdk4/types.rb', line 27174

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

27183
27184
27185
# File 'lib/ovirtsdk4/types.rb', line 27183

def id=(value)
  @id = value
end

#logical_unitsArray<LogicalUnit>

Returns the value of the logical_units attribute.

Returns:


27192
27193
27194
# File 'lib/ovirtsdk4/types.rb', line 27192

def logical_units
  @logical_units
end

#logical_units=(list) ⇒ Object

Sets the value of the logical_units attribute.

Parameters:


27201
27202
27203
27204
27205
27206
27207
27208
27209
27210
27211
# File 'lib/ovirtsdk4/types.rb', line 27201

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

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

27218
27219
27220
# File 'lib/ovirtsdk4/types.rb', line 27218

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

27227
27228
27229
# File 'lib/ovirtsdk4/types.rb', line 27227

def name=(value)
  @name = value
end