Class: OvirtSDK4::TemplateVersion

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

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

  • :base_template (Template, Hash)

    The value of attribute base_template.

  • :version_name (String)

    The value of attribute version_name.

  • :version_number (Integer)

    The value of attribute version_number.



22459
22460
22461
22462
22463
22464
# File 'lib/ovirtsdk4/types.rb', line 22459

def initialize(opts = {})
  super(opts)
  self.base_template = opts[:base_template]
  self.version_name = opts[:version_name]
  self.version_number = opts[:version_number]
end

Instance Method Details

#==(other) ⇒ Object

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



22469
22470
22471
22472
22473
22474
# File 'lib/ovirtsdk4/types.rb', line 22469

def ==(other)
  super &&
  @base_template == other.base_template &&
  @version_name == other.version_name &&
  @version_number == other.version_number
end

#base_templateTemplate

Returns the value of the base_template attribute.

Returns:



22389
22390
22391
# File 'lib/ovirtsdk4/types.rb', line 22389

def base_template
  @base_template
end

#base_template=(value) ⇒ Object

Sets the value of the base_template attribute.

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



22402
22403
22404
22405
22406
22407
# File 'lib/ovirtsdk4/types.rb', line 22402

def base_template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @base_template = value
end

#hashObject

Generates a hash value for this object.



22479
22480
22481
22482
22483
22484
# File 'lib/ovirtsdk4/types.rb', line 22479

def hash
  super +
  @base_template.hash +
  @version_name.hash +
  @version_number.hash
end

#version_nameString

Returns the value of the version_name attribute.

Returns:

  • (String)


22414
22415
22416
# File 'lib/ovirtsdk4/types.rb', line 22414

def version_name
  @version_name
end

#version_name=(value) ⇒ Object

Sets the value of the version_name attribute.

Parameters:

  • value (String)


22423
22424
22425
# File 'lib/ovirtsdk4/types.rb', line 22423

def version_name=(value)
  @version_name = value
end

#version_numberInteger

Returns the value of the version_number attribute.

Returns:

  • (Integer)


22432
22433
22434
# File 'lib/ovirtsdk4/types.rb', line 22432

def version_number
  @version_number
end

#version_number=(value) ⇒ Object

Sets the value of the version_number attribute.

Parameters:

  • value (Integer)


22441
22442
22443
# File 'lib/ovirtsdk4/types.rb', line 22441

def version_number=(value)
  @version_number = value
end