Class: OvirtSDK4::CpuProfile

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

Creates a new instance of the OvirtSDK4::CpuProfile 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 (Cluster, Hash)

    The value of attribute cluster.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :qos (Qos, Hash)

    The value of attribute qos.


33742
33743
33744
33745
33746
33747
# File 'lib/ovirtsdk4/types.rb', line 33742

def initialize(opts = {})
  super(opts)
  self.cluster = opts[:cluster]
  self.permissions = opts[:permissions]
  self.qos = opts[:qos]
end

Instance Method Details

#==(other) ⇒ Object

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


33752
33753
33754
33755
33756
33757
# File 'lib/ovirtsdk4/types.rb', line 33752

def ==(other)
  super &&
  @cluster == other.cluster &&
  @permissions == other.permissions &&
  @qos == other.qos
end

#clusterCluster

Returns the value of the cluster attribute.

Returns:


33577
33578
33579
# File 'lib/ovirtsdk4/types.rb', line 33577

def cluster
  @cluster
end

#cluster=(value) ⇒ Object

Sets the value of the cluster attribute.

The value parameter can be an instance of OvirtSDK4::Cluster 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:


33590
33591
33592
33593
33594
33595
# File 'lib/ovirtsdk4/types.rb', line 33590

def cluster=(value)
  if value.is_a?(Hash)
    value = Cluster.new(value)
  end
  @cluster = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

33602
33603
33604
# File 'lib/ovirtsdk4/types.rb', line 33602

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

33611
33612
33613
# File 'lib/ovirtsdk4/types.rb', line 33611

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

33620
33621
33622
# File 'lib/ovirtsdk4/types.rb', line 33620

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

33629
33630
33631
# File 'lib/ovirtsdk4/types.rb', line 33629

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


33762
33763
33764
33765
33766
33767
# File 'lib/ovirtsdk4/types.rb', line 33762

def hash
  super +
  @cluster.hash +
  @permissions.hash +
  @qos.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)

33638
33639
33640
# File 'lib/ovirtsdk4/types.rb', line 33638

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

33647
33648
33649
# File 'lib/ovirtsdk4/types.rb', line 33647

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

33656
33657
33658
# File 'lib/ovirtsdk4/types.rb', line 33656

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

33665
33666
33667
# File 'lib/ovirtsdk4/types.rb', line 33665

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:


33674
33675
33676
# File 'lib/ovirtsdk4/types.rb', line 33674

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


33683
33684
33685
33686
33687
33688
33689
33690
33691
33692
33693
# File 'lib/ovirtsdk4/types.rb', line 33683

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

#qosQos

Returns the value of the qos attribute.

Returns:


33700
33701
33702
# File 'lib/ovirtsdk4/types.rb', line 33700

def qos
  @qos
end

#qos=(value) ⇒ Object

Sets the value of the qos attribute.

The value parameter can be an instance of Qos 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:

  • value (Qos, Hash)

33713
33714
33715
33716
33717
33718
# File 'lib/ovirtsdk4/types.rb', line 33713

def qos=(value)
  if value.is_a?(Hash)
    value = Qos.new(value)
  end
  @qos = value
end