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.



23217
23218
23219
23220
# File 'lib/ovirtsdk4/types.rb', line 23217

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.



23225
23226
23227
23228
# File 'lib/ovirtsdk4/types.rb', line 23225

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

#commentString

Returns the value of the comment attribute.



23106
23107
23108
# File 'lib/ovirtsdk4/types.rb', line 23106

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



23115
23116
23117
# File 'lib/ovirtsdk4/types.rb', line 23115

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



23124
23125
23126
# File 'lib/ovirtsdk4/types.rb', line 23124

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



23133
23134
23135
# File 'lib/ovirtsdk4/types.rb', line 23133

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



23233
23234
23235
23236
# File 'lib/ovirtsdk4/types.rb', line 23233

def hash
  super +
  @values.hash
end

#idString

Returns the value of the id attribute.



23142
23143
23144
# File 'lib/ovirtsdk4/types.rb', line 23142

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



23151
23152
23153
# File 'lib/ovirtsdk4/types.rb', line 23151

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.



23160
23161
23162
# File 'lib/ovirtsdk4/types.rb', line 23160

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



23169
23170
23171
# File 'lib/ovirtsdk4/types.rb', line 23169

def name=(value)
  @name = value
end

#valuesArray<SystemOptionValue>

Returns the value of the values attribute.



23178
23179
23180
# File 'lib/ovirtsdk4/types.rb', line 23178

def values
  @values
end

#values=(list) ⇒ Object

Sets the value of the values attribute.



23187
23188
23189
23190
23191
23192
23193
23194
23195
23196
23197
# File 'lib/ovirtsdk4/types.rb', line 23187

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