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.

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):

  • :brick (GlusterBrick, Hash)

    The value of attribute brick.

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

    The values of attribute profile_details.



30742
30743
30744
30745
# File 'lib/ovirtsdk4/types.rb', line 30742

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.



30750
30751
30752
30753
# File 'lib/ovirtsdk4/types.rb', line 30750

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

#brickGlusterBrick

Returns the value of the brick attribute.

Returns:



30684
30685
30686
# File 'lib/ovirtsdk4/types.rb', line 30684

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.

Parameters:



30697
30698
30699
30700
30701
30702
# File 'lib/ovirtsdk4/types.rb', line 30697

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

#hashObject

Generates a hash value for this object.



30758
30759
30760
30761
# File 'lib/ovirtsdk4/types.rb', line 30758

def hash
  super +
  @brick.hash
end

#profile_detailsArray<ProfileDetail>

Returns the value of the profile_details attribute.

Returns:



30709
30710
30711
# File 'lib/ovirtsdk4/types.rb', line 30709

def profile_details
  @profile_details
end

#profile_details=(list) ⇒ Object

Sets the value of the profile_details attribute.

Parameters:



30718
30719
30720
30721
30722
30723
30724
30725
30726
30727
30728
# File 'lib/ovirtsdk4/types.rb', line 30718

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