Class: OvirtSDK4::RngDevice

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

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

  • :rate (Rate, Hash)

    The value of attribute rate.

  • :source (RngSource)

    The value of attribute source.



17558
17559
17560
17561
17562
# File 'lib/ovirtsdk4/types.rb', line 17558

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

Instance Method Details

#==(other) ⇒ Object

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



17567
17568
17569
17570
17571
# File 'lib/ovirtsdk4/types.rb', line 17567

def ==(other)
  super &&
  @rate == other.rate &&
  @source == other.source
end

#hashObject

Generates a hash value for this object.



17576
17577
17578
17579
17580
# File 'lib/ovirtsdk4/types.rb', line 17576

def hash
  super +
  @rate.hash +
  @source.hash
end

#rateRate

Returns the value of the rate attribute.

Returns:



17508
17509
17510
# File 'lib/ovirtsdk4/types.rb', line 17508

def rate
  @rate
end

#rate=(value) ⇒ Object

Sets the value of the rate attribute.

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

  • value (Rate, Hash)


17521
17522
17523
17524
17525
17526
# File 'lib/ovirtsdk4/types.rb', line 17521

def rate=(value)
  if value.is_a?(Hash)
    value = Rate.new(value)
  end
  @rate = value
end

#sourceRngSource

Returns the value of the source attribute.

Returns:



17533
17534
17535
# File 'lib/ovirtsdk4/types.rb', line 17533

def source
  @source
end

#source=(value) ⇒ Object

Sets the value of the source attribute.

Parameters:



17542
17543
17544
# File 'lib/ovirtsdk4/types.rb', line 17542

def source=(value)
  @source = value
end