Class: OvirtSDK4::Value

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

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

  • :datum (Float)

    The value of attribute datum.

  • :detail (String)

    The value of attribute detail.


23874
23875
23876
23877
23878
# File 'lib/ovirtsdk4/types.rb', line 23874

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

Instance Method Details

#==(other) ⇒ Object

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


23883
23884
23885
23886
23887
# File 'lib/ovirtsdk4/types.rb', line 23883

def ==(other)
  super &&
  @datum == other.datum &&
  @detail == other.detail
end

#datumFloat

Returns the value of the datum attribute.

Returns:

  • (Float)

23831
23832
23833
# File 'lib/ovirtsdk4/types.rb', line 23831

def datum
  @datum
end

#datum=(value) ⇒ Object

Sets the value of the datum attribute.

Parameters:

  • value (Float)

23840
23841
23842
# File 'lib/ovirtsdk4/types.rb', line 23840

def datum=(value)
  @datum = value
end

#detailString

Returns the value of the detail attribute.

Returns:

  • (String)

23849
23850
23851
# File 'lib/ovirtsdk4/types.rb', line 23849

def detail
  @detail
end

#detail=(value) ⇒ Object

Sets the value of the detail attribute.

Parameters:

  • value (String)

23858
23859
23860
# File 'lib/ovirtsdk4/types.rb', line 23858

def detail=(value)
  @detail = value
end

#hashObject

Generates a hash value for this object.


23892
23893
23894
23895
23896
# File 'lib/ovirtsdk4/types.rb', line 23892

def hash
  super +
  @datum.hash +
  @detail.hash
end