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.


14671
14672
14673
14674
14675
14676
# File 'lib/ovirtsdk4/types.rb', line 14671

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.


14681
14682
14683
14684
14685
14686
# File 'lib/ovirtsdk4/types.rb', line 14681

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

#hashObject

Generates a hash value for this object.


14691
14692
14693
14694
14695
14696
# File 'lib/ovirtsdk4/types.rb', line 14691

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

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

14601
14602
14603
# File 'lib/ovirtsdk4/types.rb', line 14601

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

14610
14611
14612
# File 'lib/ovirtsdk4/types.rb', line 14610

def name=(value)
  @name = value
end

#vendorString

Returns the value of the vendor attribute.

Returns:

  • (String)

14619
14620
14621
# File 'lib/ovirtsdk4/types.rb', line 14619

def vendor
  @vendor
end

#vendor=(value) ⇒ Object

Sets the value of the vendor attribute.

Parameters:

  • value (String)

14628
14629
14630
# File 'lib/ovirtsdk4/types.rb', line 14628

def vendor=(value)
  @vendor = value
end

#versionVersion

Returns the value of the version attribute.

Returns:


14637
14638
14639
# File 'lib/ovirtsdk4/types.rb', line 14637

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:


14650
14651
14652
14653
14654
14655
# File 'lib/ovirtsdk4/types.rb', line 14650

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