Class: OvirtSDK4::BlockStatistic
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
true
ifself
andother
have the same attributes and values. -
#hash ⇒ Object
Generates a hash value for this object.
-
#initialize(opts = {}) ⇒ BlockStatistic
constructor
Creates a new instance of the BlockStatistic class.
-
#statistics ⇒ Array<Statistic>
Returns the value of the
statistics
attribute. -
#statistics=(list) ⇒ Object
Sets the value of the
statistics
attribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ BlockStatistic
Creates a new instance of the OvirtSDK4::BlockStatistic class.
1497 1498 1499 1500 |
# File 'lib/ovirtsdk4/types.rb', line 1497 def initialize(opts = {}) super(opts) self.statistics = opts[:statistics] end |
Instance Method Details
#==(other) ⇒ Object
Returns true
if self
and other
have the same attributes and values.
1505 1506 1507 1508 |
# File 'lib/ovirtsdk4/types.rb', line 1505 def ==(other) super && @statistics == other.statistics end |
#hash ⇒ Object
Generates a hash value for this object.
1513 1514 1515 1516 |
# File 'lib/ovirtsdk4/types.rb', line 1513 def hash super + @statistics.hash end |
#statistics ⇒ Array<Statistic>
Returns the value of the statistics
attribute.
1466 1467 1468 |
# File 'lib/ovirtsdk4/types.rb', line 1466 def statistics @statistics end |
#statistics=(list) ⇒ Object
Sets the value of the statistics
attribute.
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 |
# File 'lib/ovirtsdk4/types.rb', line 1475 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 |