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.

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.



22194
22195
22196
22197
# File 'lib/ovirtsdk4/types.rb', line 22194

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.



22202
22203
22204
22205
# File 'lib/ovirtsdk4/types.rb', line 22202

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

#commentString

Returns the value of the comment attribute.



22083
22084
22085
# File 'lib/ovirtsdk4/types.rb', line 22083

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



22092
22093
22094
# File 'lib/ovirtsdk4/types.rb', line 22092

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



22101
22102
22103
# File 'lib/ovirtsdk4/types.rb', line 22101

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



22110
22111
22112
# File 'lib/ovirtsdk4/types.rb', line 22110

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



22210
22211
22212
22213
# File 'lib/ovirtsdk4/types.rb', line 22210

def hash
  super +
  @values.hash
end

#idString

Returns the value of the id attribute.



22119
22120
22121
# File 'lib/ovirtsdk4/types.rb', line 22119

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



22128
22129
22130
# File 'lib/ovirtsdk4/types.rb', line 22128

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.



22137
22138
22139
# File 'lib/ovirtsdk4/types.rb', line 22137

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



22146
22147
22148
# File 'lib/ovirtsdk4/types.rb', line 22146

def name=(value)
  @name = value
end

#valuesArray<SystemOptionValue>

Returns the value of the values attribute.



22155
22156
22157
# File 'lib/ovirtsdk4/types.rb', line 22155

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.



22164
22165
22166
22167
22168
22169
22170
22171
22172
22173
22174
# File 'lib/ovirtsdk4/types.rb', line 22164

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