Class: OvirtSDK4::Rate

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

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

  • :bytes (Integer)

    The value of attribute bytes.

  • :period (Integer)

    The value of attribute period.



16249
16250
16251
16252
16253
# File 'lib/ovirtsdk4/types.rb', line 16249

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

Instance Method Details

#==(other) ⇒ Object

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



16258
16259
16260
16261
16262
# File 'lib/ovirtsdk4/types.rb', line 16258

def ==(other)
  super &&
  @bytes == other.bytes &&
  @period == other.period
end

#bytesInteger

Returns the value of the bytes attribute.

Returns:

  • (Integer)


16206
16207
16208
# File 'lib/ovirtsdk4/types.rb', line 16206

def bytes
  @bytes
end

#bytes=(value) ⇒ Object

Sets the value of the bytes attribute.

Parameters:

  • value (Integer)


16215
16216
16217
# File 'lib/ovirtsdk4/types.rb', line 16215

def bytes=(value)
  @bytes = value
end

#hashObject

Generates a hash value for this object.



16267
16268
16269
16270
16271
# File 'lib/ovirtsdk4/types.rb', line 16267

def hash
  super +
  @bytes.hash +
  @period.hash
end

#periodInteger

Returns the value of the period attribute.

Returns:

  • (Integer)


16224
16225
16226
# File 'lib/ovirtsdk4/types.rb', line 16224

def period
  @period
end

#period=(value) ⇒ Object

Sets the value of the period attribute.

Parameters:

  • value (Integer)


16233
16234
16235
# File 'lib/ovirtsdk4/types.rb', line 16233

def period=(value)
  @period = value
end