Class: OvirtSDK4::ProductInfo

Inherits:
Struct
  • Object
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 = {}) ⇒ ProductInfo

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

  • :instance_id (String)

    The value of attribute instance_id.

  • :name (String)

    The value of attribute name.

  • :vendor (String)

    The value of attribute vendor.

  • :version (Version, Hash)

    The value of attribute version.



15247
15248
15249
15250
15251
15252
15253
# File 'lib/ovirtsdk4/types.rb', line 15247

def initialize(opts = {})
  super(opts)
  self.instance_id = opts[:instance_id]
  self.name = opts[:name]
  self.vendor = opts[:vendor]
  self.version = opts[:version]
end

Instance Method Details

#==(other) ⇒ Object

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



15258
15259
15260
15261
15262
15263
15264
# File 'lib/ovirtsdk4/types.rb', line 15258

def ==(other)
  super &&
  @instance_id == other.instance_id &&
  @name == other.name &&
  @vendor == other.vendor &&
  @version == other.version
end

#hashObject

Generates a hash value for this object.



15269
15270
15271
15272
15273
15274
15275
# File 'lib/ovirtsdk4/types.rb', line 15269

def hash
  super +
  @instance_id.hash +
  @name.hash +
  @vendor.hash +
  @version.hash
end

#instance_idString

Returns the value of the instance_id attribute.

Returns:

  • (String)


15157
15158
15159
# File 'lib/ovirtsdk4/types.rb', line 15157

def instance_id
  @instance_id
end

#instance_id=(value) ⇒ Object

Sets the value of the instance_id attribute.

Parameters:

  • value (String)


15166
15167
15168
# File 'lib/ovirtsdk4/types.rb', line 15166

def instance_id=(value)
  @instance_id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


15175
15176
15177
# File 'lib/ovirtsdk4/types.rb', line 15175

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


15184
15185
15186
# File 'lib/ovirtsdk4/types.rb', line 15184

def name=(value)
  @name = value
end

#vendorString

Returns the value of the vendor attribute.

Returns:

  • (String)


15193
15194
15195
# File 'lib/ovirtsdk4/types.rb', line 15193

def vendor
  @vendor
end

#vendor=(value) ⇒ Object

Sets the value of the vendor attribute.

Parameters:

  • value (String)


15202
15203
15204
# File 'lib/ovirtsdk4/types.rb', line 15202

def vendor=(value)
  @vendor = value
end

#versionVersion

Returns the value of the version attribute.

Returns:



15211
15212
15213
# File 'lib/ovirtsdk4/types.rb', line 15211

def version
  @version
end

#version=(value) ⇒ Object

Sets the value of the version attribute.

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



15224
15225
15226
15227
15228
15229
# File 'lib/ovirtsdk4/types.rb', line 15224

def version=(value)
  if value.is_a?(Hash)
    value = Version.new(value)
  end
  @version = value
end