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.



33024
33025
33026
33027
# File 'lib/ovirtsdk4/types.rb', line 33024

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.



33032
33033
33034
33035
# File 'lib/ovirtsdk4/types.rb', line 33032

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

#brickGlusterBrick

Returns the value of the brick attribute.



32966
32967
32968
# File 'lib/ovirtsdk4/types.rb', line 32966

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.



32979
32980
32981
32982
32983
32984
# File 'lib/ovirtsdk4/types.rb', line 32979

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

#hashObject

Generates a hash value for this object.



33040
33041
33042
33043
# File 'lib/ovirtsdk4/types.rb', line 33040

def hash
  super +
  @brick.hash
end

#profile_detailsArray<ProfileDetail>

Returns the value of the profile_details attribute.



32991
32992
32993
# File 'lib/ovirtsdk4/types.rb', line 32991

def profile_details
  @profile_details
end

#profile_details=(list) ⇒ Object

Sets the value of the profile_details attribute.



33000
33001
33002
33003
33004
33005
33006
33007
33008
33009
33010
# File 'lib/ovirtsdk4/types.rb', line 33000

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