Class: OvirtSDK4::CpuTopology

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

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

  • :cores (Integer)

    The value of attribute cores.

  • :sockets (Integer)

    The value of attribute sockets.

  • :threads (Integer)

    The value of attribute threads.



2491
2492
2493
2494
2495
2496
# File 'lib/ovirtsdk4/types.rb', line 2491

def initialize(opts = {})
  super(opts)
  self.cores = opts[:cores]
  self.sockets = opts[:sockets]
  self.threads = opts[:threads]
end

Instance Method Details

#==(other) ⇒ Object

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



2501
2502
2503
2504
2505
2506
# File 'lib/ovirtsdk4/types.rb', line 2501

def ==(other)
  super &&
  @cores == other.cores &&
  @sockets == other.sockets &&
  @threads == other.threads
end

#coresInteger

Returns the value of the cores attribute.

Returns:

  • (Integer)


2428
2429
2430
# File 'lib/ovirtsdk4/types.rb', line 2428

def cores
  @cores
end

#cores=(value) ⇒ Object

Sets the value of the cores attribute.

Parameters:

  • value (Integer)


2437
2438
2439
# File 'lib/ovirtsdk4/types.rb', line 2437

def cores=(value)
  @cores = value
end

#hashObject

Generates a hash value for this object.



2511
2512
2513
2514
2515
2516
# File 'lib/ovirtsdk4/types.rb', line 2511

def hash
  super +
  @cores.hash +
  @sockets.hash +
  @threads.hash
end

#socketsInteger

Returns the value of the sockets attribute.

Returns:

  • (Integer)


2446
2447
2448
# File 'lib/ovirtsdk4/types.rb', line 2446

def sockets
  @sockets
end

#sockets=(value) ⇒ Object

Sets the value of the sockets attribute.

Parameters:

  • value (Integer)


2455
2456
2457
# File 'lib/ovirtsdk4/types.rb', line 2455

def sockets=(value)
  @sockets = value
end

#threadsInteger

Returns the value of the threads attribute.

Returns:

  • (Integer)


2464
2465
2466
# File 'lib/ovirtsdk4/types.rb', line 2464

def threads
  @threads
end

#threads=(value) ⇒ Object

Sets the value of the threads attribute.

Parameters:

  • value (Integer)


2473
2474
2475
# File 'lib/ovirtsdk4/types.rb', line 2473

def threads=(value)
  @threads = value
end