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.



32527
32528
32529
32530
32531
32532
# File 'lib/ovirtsdk4/types.rb', line 32527

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.



32537
32538
32539
32540
32541
32542
# File 'lib/ovirtsdk4/types.rb', line 32537

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:



32360
32361
32362
# File 'lib/ovirtsdk4/types.rb', line 32360

def cluster_features
  @cluster_features
end

#cluster_features=(list) ⇒ Object

Sets the value of the cluster_features attribute.

Parameters:



32369
32370
32371
32372
32373
32374
32375
32376
32377
32378
32379
# File 'lib/ovirtsdk4/types.rb', line 32369

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)


32386
32387
32388
# File 'lib/ovirtsdk4/types.rb', line 32386

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


32395
32396
32397
# File 'lib/ovirtsdk4/types.rb', line 32395

def comment=(value)
  @comment = value
end

#cpu_typesArray<CpuType>

Returns the value of the cpu_types attribute.

Returns:



32404
32405
32406
# File 'lib/ovirtsdk4/types.rb', line 32404

def cpu_types
  @cpu_types
end

#cpu_types=(list) ⇒ Object

Sets the value of the cpu_types attribute.

Parameters:



32413
32414
32415
32416
32417
32418
32419
32420
32421
32422
32423
# File 'lib/ovirtsdk4/types.rb', line 32413

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)


32430
32431
32432
# File 'lib/ovirtsdk4/types.rb', line 32430

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


32439
32440
32441
# File 'lib/ovirtsdk4/types.rb', line 32439

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



32547
32548
32549
32550
32551
32552
# File 'lib/ovirtsdk4/types.rb', line 32547

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


32448
32449
32450
# File 'lib/ovirtsdk4/types.rb', line 32448

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


32457
32458
32459
# File 'lib/ovirtsdk4/types.rb', line 32457

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


32466
32467
32468
# File 'lib/ovirtsdk4/types.rb', line 32466

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


32475
32476
32477
# File 'lib/ovirtsdk4/types.rb', line 32475

def name=(value)
  @name = value
end

#permitsArray<Permit>

Returns the value of the permits attribute.

Returns:



32484
32485
32486
# File 'lib/ovirtsdk4/types.rb', line 32484

def permits
  @permits
end

#permits=(list) ⇒ Object

Sets the value of the permits attribute.

Parameters:



32493
32494
32495
32496
32497
32498
32499
32500
32501
32502
32503
# File 'lib/ovirtsdk4/types.rb', line 32493

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