Class: OvirtSDK4::BrickProfileDetail

Inherits:
EntityProfileDetail 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 = {}) ⇒ BrickProfileDetail

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

Options Hash (opts):

  • :brick (GlusterBrick, Hash)

    The value of attribute brick.

  • :profile_details (Array<ProfileDetail>, Array<Hash>)

    The values of attribute profile_details.



33317
33318
33319
33320
# File 'lib/ovirtsdk4/types.rb', line 33317

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

Instance Method Details

#==(other) ⇒ Object

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



33325
33326
33327
33328
# File 'lib/ovirtsdk4/types.rb', line 33325

def ==(other)
  super &&
  @brick == other.brick
end

#brickGlusterBrick

Returns the value of the brick attribute.



33259
33260
33261
# File 'lib/ovirtsdk4/types.rb', line 33259

def brick
  @brick
end

#brick=(value) ⇒ Object

Sets the value of the brick attribute.

The value parameter can be an instance of GlusterBrick or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.



33272
33273
33274
33275
33276
33277
# File 'lib/ovirtsdk4/types.rb', line 33272

def brick=(value)
  if value.is_a?(Hash)
    value = GlusterBrick.new(value)
  end
  @brick = value
end

#hashObject

Generates a hash value for this object.



33333
33334
33335
33336
# File 'lib/ovirtsdk4/types.rb', line 33333

def hash
  super +
  @brick.hash
end

#profile_detailsArray<ProfileDetail>

Returns the value of the profile_details attribute.



33284
33285
33286
# File 'lib/ovirtsdk4/types.rb', line 33284

def profile_details
  @profile_details
end

#profile_details=(list) ⇒ Object

Sets the value of the profile_details attribute.



33293
33294
33295
33296
33297
33298
33299
33300
33301
33302
33303
# File 'lib/ovirtsdk4/types.rb', line 33293

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