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

#href, #href=

Constructor Details

- (FopStatistic) initialize(opts = {})

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.



2811
2812
2813
2814
2815
# File 'lib/ovirtsdk4/types.rb', line 2811

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

Instance Method Details

- (String) name

Returns the value of the name attribute.

Returns:

  • (String)


2761
2762
2763
# File 'lib/ovirtsdk4/types.rb', line 2761

def name
  return @name
end

- (Object) name=(value)

Sets the value of the name attribute.

Parameters:

  • value (String)


2770
2771
2772
# File 'lib/ovirtsdk4/types.rb', line 2770

def name=(value)
  @name = value
end

- (Array<Statistic>) statistics

Returns the value of the statistics attribute.

Returns:



2779
2780
2781
# File 'lib/ovirtsdk4/types.rb', line 2779

def statistics
  return @statistics
end

- (Object) statistics=(list)

Sets the value of the statistics attribute.

Parameters:



2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
# File 'lib/ovirtsdk4/types.rb', line 2787

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