Class: OvirtSDK4::ClusterLevel

Inherits:
Identified 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 = {}) ⇒ ClusterLevel

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

  • :cluster_features (Array<ClusterFeature>, Array<Hash>)

    The values of attribute cluster_features.

  • :comment (String)

    The value of attribute comment.

  • :cpu_types (Array<CpuType>, Array<Hash>)

    The values of attribute cpu_types.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :permits (Array<Permit>, Array<Hash>)

    The values of attribute permits.



35397
35398
35399
35400
35401
35402
# File 'lib/ovirtsdk4/types.rb', line 35397

def initialize(opts = {})
  super(opts)
  self.cluster_features = opts[:cluster_features]
  self.cpu_types = opts[:cpu_types]
  self.permits = opts[:permits]
end

Instance Method Details

#==(other) ⇒ Object

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



35407
35408
35409
35410
35411
35412
# File 'lib/ovirtsdk4/types.rb', line 35407

def ==(other)
  super &&
  @cluster_features == other.cluster_features &&
  @cpu_types == other.cpu_types &&
  @permits == other.permits
end

#cluster_featuresArray<ClusterFeature>

Returns the value of the cluster_features attribute.

Returns:



35230
35231
35232
# File 'lib/ovirtsdk4/types.rb', line 35230

def cluster_features
  @cluster_features
end

#cluster_features=(list) ⇒ Object

Sets the value of the cluster_features attribute.

Parameters:



35239
35240
35241
35242
35243
35244
35245
35246
35247
35248
35249
# File 'lib/ovirtsdk4/types.rb', line 35239

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


35256
35257
35258
# File 'lib/ovirtsdk4/types.rb', line 35256

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


35265
35266
35267
# File 'lib/ovirtsdk4/types.rb', line 35265

def comment=(value)
  @comment = value
end

#cpu_typesArray<CpuType>

Returns the value of the cpu_types attribute.

Returns:



35274
35275
35276
# File 'lib/ovirtsdk4/types.rb', line 35274

def cpu_types
  @cpu_types
end

#cpu_types=(list) ⇒ Object

Sets the value of the cpu_types attribute.

Parameters:



35283
35284
35285
35286
35287
35288
35289
35290
35291
35292
35293
# File 'lib/ovirtsdk4/types.rb', line 35283

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

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


35300
35301
35302
# File 'lib/ovirtsdk4/types.rb', line 35300

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


35309
35310
35311
# File 'lib/ovirtsdk4/types.rb', line 35309

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



35417
35418
35419
35420
35421
35422
# File 'lib/ovirtsdk4/types.rb', line 35417

def hash
  super +
  @cluster_features.hash +
  @cpu_types.hash +
  @permits.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


35318
35319
35320
# File 'lib/ovirtsdk4/types.rb', line 35318

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


35327
35328
35329
# File 'lib/ovirtsdk4/types.rb', line 35327

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


35336
35337
35338
# File 'lib/ovirtsdk4/types.rb', line 35336

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


35345
35346
35347
# File 'lib/ovirtsdk4/types.rb', line 35345

def name=(value)
  @name = value
end

#permitsArray<Permit>

Returns the value of the permits attribute.

Returns:



35354
35355
35356
# File 'lib/ovirtsdk4/types.rb', line 35354

def permits
  @permits
end

#permits=(list) ⇒ Object

Sets the value of the permits attribute.

Parameters:



35363
35364
35365
35366
35367
35368
35369
35370
35371
35372
35373
# File 'lib/ovirtsdk4/types.rb', line 35363

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