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.



14581
14582
14583
14584
14585
14586
14587
14588
# File 'lib/ovirtsdk4/types.rb', line 14581

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.



14593
14594
14595
14596
14597
14598
14599
14600
# File 'lib/ovirtsdk4/types.rb', line 14593

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:



14454
14455
14456
# File 'lib/ovirtsdk4/types.rb', line 14454

def block_statistics
  @block_statistics
end

#block_statistics=(list) ⇒ Object

Sets the value of the block_statistics attribute.

Parameters:



14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
# File 'lib/ovirtsdk4/types.rb', line 14463

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)


14480
14481
14482
# File 'lib/ovirtsdk4/types.rb', line 14480

def duration
  @duration
end

#duration=(value) ⇒ Object

Sets the value of the duration attribute.

Parameters:

  • value (Integer)


14489
14490
14491
# File 'lib/ovirtsdk4/types.rb', line 14489

def duration=(value)
  @duration = value
end

#fop_statisticsArray<FopStatistic>

Returns the value of the fop_statistics attribute.

Returns:



14498
14499
14500
# File 'lib/ovirtsdk4/types.rb', line 14498

def fop_statistics
  @fop_statistics
end

#fop_statistics=(list) ⇒ Object

Sets the value of the fop_statistics attribute.

Parameters:



14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
# File 'lib/ovirtsdk4/types.rb', line 14507

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.



14605
14606
14607
14608
14609
14610
14611
14612
# File 'lib/ovirtsdk4/types.rb', line 14605

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)


14524
14525
14526
# File 'lib/ovirtsdk4/types.rb', line 14524

def profile_type
  @profile_type
end

#profile_type=(value) ⇒ Object

Sets the value of the profile_type attribute.

Parameters:

  • value (String)


14533
14534
14535
# File 'lib/ovirtsdk4/types.rb', line 14533

def profile_type=(value)
  @profile_type = value
end

#statisticsArray<Statistic>

Returns the value of the statistics attribute.

Returns:



14542
14543
14544
# File 'lib/ovirtsdk4/types.rb', line 14542

def statistics
  @statistics
end

#statistics=(list) ⇒ Object

Sets the value of the statistics attribute.

Parameters:



14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
# File 'lib/ovirtsdk4/types.rb', line 14551

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