Class: OvirtSDK4::FopStatistic

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

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

  • :name (String)

    The value of attribute name.

  • :statistics (Array<Statistic>, Array<Hash>)

    The values of attribute statistics.


4100
4101
4102
4103
4104
# File 'lib/ovirtsdk4/types.rb', line 4100

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

Instance Method Details

#==(other) ⇒ Object

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


4109
4110
4111
4112
4113
# File 'lib/ovirtsdk4/types.rb', line 4109

def ==(other)
  super &&
  @name == other.name &&
  @statistics == other.statistics
end

#hashObject

Generates a hash value for this object.


4118
4119
4120
4121
4122
# File 'lib/ovirtsdk4/types.rb', line 4118

def hash
  super +
  @name.hash +
  @statistics.hash
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

4049
4050
4051
# File 'lib/ovirtsdk4/types.rb', line 4049

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

4058
4059
4060
# File 'lib/ovirtsdk4/types.rb', line 4058

def name=(value)
  @name = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


4067
4068
4069
# File 'lib/ovirtsdk4/types.rb', line 4067

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
# File 'lib/ovirtsdk4/types.rb', line 4076

def statistics=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Statistic.new(value)
      end
    end
  end
  @statistics = list
end