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.



35104
35105
35106
35107
35108
35109
# File 'lib/ovirtsdk4/types.rb', line 35104

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.



35114
35115
35116
35117
35118
35119
# File 'lib/ovirtsdk4/types.rb', line 35114

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:



34937
34938
34939
# File 'lib/ovirtsdk4/types.rb', line 34937

def cluster_features
  @cluster_features
end

#cluster_features=(list) ⇒ Object

Sets the value of the cluster_features attribute.

Parameters:



34946
34947
34948
34949
34950
34951
34952
34953
34954
34955
34956
# File 'lib/ovirtsdk4/types.rb', line 34946

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)


34963
34964
34965
# File 'lib/ovirtsdk4/types.rb', line 34963

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


34972
34973
34974
# File 'lib/ovirtsdk4/types.rb', line 34972

def comment=(value)
  @comment = value
end

#cpu_typesArray<CpuType>

Returns the value of the cpu_types attribute.

Returns:



34981
34982
34983
# File 'lib/ovirtsdk4/types.rb', line 34981

def cpu_types
  @cpu_types
end

#cpu_types=(list) ⇒ Object

Sets the value of the cpu_types attribute.

Parameters:



34990
34991
34992
34993
34994
34995
34996
34997
34998
34999
35000
# File 'lib/ovirtsdk4/types.rb', line 34990

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)


35007
35008
35009
# File 'lib/ovirtsdk4/types.rb', line 35007

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


35016
35017
35018
# File 'lib/ovirtsdk4/types.rb', line 35016

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



35124
35125
35126
35127
35128
35129
# File 'lib/ovirtsdk4/types.rb', line 35124

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)


35025
35026
35027
# File 'lib/ovirtsdk4/types.rb', line 35025

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


35034
35035
35036
# File 'lib/ovirtsdk4/types.rb', line 35034

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


35043
35044
35045
# File 'lib/ovirtsdk4/types.rb', line 35043

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


35052
35053
35054
# File 'lib/ovirtsdk4/types.rb', line 35052

def name=(value)
  @name = value
end

#permitsArray<Permit>

Returns the value of the permits attribute.

Returns:



35061
35062
35063
# File 'lib/ovirtsdk4/types.rb', line 35061

def permits
  @permits
end

#permits=(list) ⇒ Object

Sets the value of the permits attribute.

Parameters:



35070
35071
35072
35073
35074
35075
35076
35077
35078
35079
35080
# File 'lib/ovirtsdk4/types.rb', line 35070

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