Class: OvirtSDK4::ProfileDetail

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

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

  • :block_statistics (Array<BlockStatistic>, Array<Hash>)

    The values of attribute block_statistics.

  • :duration (Integer)

    The value of attribute duration.

  • :fop_statistics (Array<FopStatistic>, Array<Hash>)

    The values of attribute fop_statistics.

  • :profile_type (String)

    The value of attribute profile_type.

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

    The values of attribute statistics.


14834
14835
14836
14837
14838
14839
14840
14841
# File 'lib/ovirtsdk4/types.rb', line 14834

def initialize(opts = {})
  super(opts)
  self.block_statistics = opts[:block_statistics]
  self.duration = opts[:duration]
  self.fop_statistics = opts[:fop_statistics]
  self.profile_type = opts[:profile_type]
  self.statistics = opts[:statistics]
end

Instance Method Details

#==(other) ⇒ Object

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


14846
14847
14848
14849
14850
14851
14852
14853
# File 'lib/ovirtsdk4/types.rb', line 14846

def ==(other)
  super &&
  @block_statistics == other.block_statistics &&
  @duration == other.duration &&
  @fop_statistics == other.fop_statistics &&
  @profile_type == other.profile_type &&
  @statistics == other.statistics
end

#block_statisticsArray<BlockStatistic>

Returns the value of the block_statistics attribute.

Returns:


14707
14708
14709
# File 'lib/ovirtsdk4/types.rb', line 14707

def block_statistics
  @block_statistics
end

#block_statistics=(list) ⇒ Object

Sets the value of the block_statistics attribute.

Parameters:


14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
# File 'lib/ovirtsdk4/types.rb', line 14716

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

#durationInteger

Returns the value of the duration attribute.

Returns:

  • (Integer)

14733
14734
14735
# File 'lib/ovirtsdk4/types.rb', line 14733

def duration
  @duration
end

#duration=(value) ⇒ Object

Sets the value of the duration attribute.

Parameters:

  • value (Integer)

14742
14743
14744
# File 'lib/ovirtsdk4/types.rb', line 14742

def duration=(value)
  @duration = value
end

#fop_statisticsArray<FopStatistic>

Returns the value of the fop_statistics attribute.

Returns:


14751
14752
14753
# File 'lib/ovirtsdk4/types.rb', line 14751

def fop_statistics
  @fop_statistics
end

#fop_statistics=(list) ⇒ Object

Sets the value of the fop_statistics attribute.

Parameters:


14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
# File 'lib/ovirtsdk4/types.rb', line 14760

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

#hashObject

Generates a hash value for this object.


14858
14859
14860
14861
14862
14863
14864
14865
# File 'lib/ovirtsdk4/types.rb', line 14858

def hash
  super +
  @block_statistics.hash +
  @duration.hash +
  @fop_statistics.hash +
  @profile_type.hash +
  @statistics.hash
end

#profile_typeString

Returns the value of the profile_type attribute.

Returns:

  • (String)

14777
14778
14779
# File 'lib/ovirtsdk4/types.rb', line 14777

def profile_type
  @profile_type
end

#profile_type=(value) ⇒ Object

Sets the value of the profile_type attribute.

Parameters:

  • value (String)

14786
14787
14788
# File 'lib/ovirtsdk4/types.rb', line 14786

def profile_type=(value)
  @profile_type = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:


14795
14796
14797
# File 'lib/ovirtsdk4/types.rb', line 14795

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:


14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
# File 'lib/ovirtsdk4/types.rb', line 14804

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