Class: OvirtSDK4::Kernel

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 = {}) ⇒ Kernel

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

  • :version (Version, Hash)

    The value of attribute version.



7873
7874
7875
7876
# File 'lib/ovirtsdk4/types.rb', line 7873

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

Instance Method Details

#==(other) ⇒ Object

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



7881
7882
7883
7884
# File 'lib/ovirtsdk4/types.rb', line 7881

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

#hashObject

Generates a hash value for this object.



7889
7890
7891
7892
# File 'lib/ovirtsdk4/types.rb', line 7889

def hash
  super +
  @version.hash
end

#versionVersion

Returns the value of the version attribute.

Returns:



7843
7844
7845
# File 'lib/ovirtsdk4/types.rb', line 7843

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:



7856
7857
7858
7859
7860
7861
# File 'lib/ovirtsdk4/types.rb', line 7856

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