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):

  • :name (String)

    The value of attribute name.

  • :vendor (String)

    The value of attribute vendor.

  • :version (Version, Hash)

    The value of attribute version.



14372
14373
14374
14375
14376
14377
# File 'lib/ovirtsdk4/types.rb', line 14372

def initialize(opts = {})
  super(opts)
  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.



14382
14383
14384
14385
14386
14387
# File 'lib/ovirtsdk4/types.rb', line 14382

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

#hashObject

Generates a hash value for this object.



14392
14393
14394
14395
14396
14397
# File 'lib/ovirtsdk4/types.rb', line 14392

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

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


14302
14303
14304
# File 'lib/ovirtsdk4/types.rb', line 14302

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


14311
14312
14313
# File 'lib/ovirtsdk4/types.rb', line 14311

def name=(value)
  @name = value
end

#vendorString

Returns the value of the vendor attribute.

Returns:

  • (String)


14320
14321
14322
# File 'lib/ovirtsdk4/types.rb', line 14320

def vendor
  @vendor
end

#vendor=(value) ⇒ Object

Sets the value of the vendor attribute.

Parameters:

  • value (String)


14329
14330
14331
# File 'lib/ovirtsdk4/types.rb', line 14329

def vendor=(value)
  @vendor = value
end

#versionVersion

Returns the value of the version attribute.

Returns:



14338
14339
14340
# File 'lib/ovirtsdk4/types.rb', line 14338

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:



14351
14352
14353
14354
14355
14356
# File 'lib/ovirtsdk4/types.rb', line 14351

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