Class: OvirtSDK4::SystemOption

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

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

  • :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.

  • :values (Array<SystemOptionValue>, Array<Hash>)

    The values of attribute values.



21993
21994
21995
21996
# File 'lib/ovirtsdk4/types.rb', line 21993

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

Instance Method Details

#==(other) ⇒ Object

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



22001
22002
22003
22004
# File 'lib/ovirtsdk4/types.rb', line 22001

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


21882
21883
21884
# File 'lib/ovirtsdk4/types.rb', line 21882

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


21891
21892
21893
# File 'lib/ovirtsdk4/types.rb', line 21891

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


21900
21901
21902
# File 'lib/ovirtsdk4/types.rb', line 21900

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


21909
21910
21911
# File 'lib/ovirtsdk4/types.rb', line 21909

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



22009
22010
22011
22012
# File 'lib/ovirtsdk4/types.rb', line 22009

def hash
  super +
  @values.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


21918
21919
21920
# File 'lib/ovirtsdk4/types.rb', line 21918

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


21927
21928
21929
# File 'lib/ovirtsdk4/types.rb', line 21927

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


21936
21937
21938
# File 'lib/ovirtsdk4/types.rb', line 21936

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


21945
21946
21947
# File 'lib/ovirtsdk4/types.rb', line 21945

def name=(value)
  @name = value
end

#valuesArray<SystemOptionValue>

Returns the value of the values attribute.

Returns:



21954
21955
21956
# File 'lib/ovirtsdk4/types.rb', line 21954

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.

Parameters:



21963
21964
21965
21966
21967
21968
21969
21970
21971
21972
21973
# File 'lib/ovirtsdk4/types.rb', line 21963

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