Class: OvirtSDK4::GlusterBrickMemoryInfo

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

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

  • :memory_pools (Array<GlusterMemoryPool>, Array<Hash>)

    The values of attribute memory_pools.


4164
4165
4166
4167
# File 'lib/ovirtsdk4/types.rb', line 4164

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

Instance Method Details

#==(other) ⇒ Object

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


4172
4173
4174
4175
# File 'lib/ovirtsdk4/types.rb', line 4172

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

#hashObject

Generates a hash value for this object.


4180
4181
4182
4183
# File 'lib/ovirtsdk4/types.rb', line 4180

def hash
  super +
  @memory_pools.hash
end

#memory_poolsArray<GlusterMemoryPool>

Returns the value of the memory_pools attribute.

Returns:


4133
4134
4135
# File 'lib/ovirtsdk4/types.rb', line 4133

def memory_pools
  @memory_pools
end

#memory_pools=(list) ⇒ Object

Sets the value of the memory_pools attribute.

Parameters:


4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
# File 'lib/ovirtsdk4/types.rb', line 4142

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