Class: OvirtSDK4::Cpu
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
trueifselfandotherhave the same attributes and values. -
#architecture ⇒ Architecture
Returns the value of the
architectureattribute. -
#architecture=(value) ⇒ Object
Sets the value of the
architectureattribute. -
#cores ⇒ Array<Core>
Returns the value of the
coresattribute. -
#cores=(list) ⇒ Object
Sets the value of the
coresattribute. -
#cpu_tune ⇒ CpuTune
Returns the value of the
cpu_tuneattribute. -
#cpu_tune=(value) ⇒ Object
Sets the value of the
cpu_tuneattribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#initialize(opts = {}) ⇒ Cpu
constructor
Creates a new instance of the Cpu class.
-
#level ⇒ Integer
Returns the value of the
levelattribute. -
#level=(value) ⇒ Object
Sets the value of the
levelattribute. -
#mode ⇒ CpuMode
Returns the value of the
modeattribute. -
#mode=(value) ⇒ Object
Sets the value of the
modeattribute. -
#name ⇒ String
Returns the value of the
nameattribute. -
#name=(value) ⇒ Object
Sets the value of the
nameattribute. -
#speed ⇒ Float
Returns the value of the
speedattribute. -
#speed=(value) ⇒ Object
Sets the value of the
speedattribute. -
#topology ⇒ CpuTopology
Returns the value of the
topologyattribute. -
#topology=(value) ⇒ Object
Sets the value of the
topologyattribute. -
#type ⇒ String
Returns the value of the
typeattribute. -
#type=(value) ⇒ Object
Sets the value of the
typeattribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ Cpu
Creates a new instance of the OvirtSDK4::Cpu class.
2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 |
# File 'lib/ovirtsdk4/types.rb', line 2457 def initialize(opts = {}) super(opts) self.architecture = opts[:architecture] self.cores = opts[:cores] self.cpu_tune = opts[:cpu_tune] self.level = opts[:level] self.mode = opts[:mode] self.name = opts[:name] self.speed = opts[:speed] self.topology = opts[:topology] self.type = opts[:type] end |
Instance Method Details
#==(other) ⇒ Object
Returns true if self and other have the same attributes and values.
2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 |
# File 'lib/ovirtsdk4/types.rb', line 2473 def ==(other) super && @architecture == other.architecture && @cores == other.cores && @cpu_tune == other.cpu_tune && @level == other.level && @mode == other.mode && @name == other.name && @speed == other.speed && @topology == other.topology && @type == other.type end |
#architecture ⇒ Architecture
Returns the value of the architecture attribute.
2252 2253 2254 |
# File 'lib/ovirtsdk4/types.rb', line 2252 def architecture @architecture end |
#architecture=(value) ⇒ Object
Sets the value of the architecture attribute.
2261 2262 2263 |
# File 'lib/ovirtsdk4/types.rb', line 2261 def architecture=(value) @architecture = value end |
#cores ⇒ Array<Core>
Returns the value of the cores attribute.
2270 2271 2272 |
# File 'lib/ovirtsdk4/types.rb', line 2270 def cores @cores end |
#cores=(list) ⇒ Object
Sets the value of the cores attribute.
2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 |
# File 'lib/ovirtsdk4/types.rb', line 2279 def cores=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Core.new(value) end end end @cores = list end |
#cpu_tune ⇒ CpuTune
Returns the value of the cpu_tune attribute.
2296 2297 2298 |
# File 'lib/ovirtsdk4/types.rb', line 2296 def cpu_tune @cpu_tune end |
#cpu_tune=(value) ⇒ Object
Sets the value of the cpu_tune attribute.
The value parameter can be an instance of OvirtSDK4::CpuTune or a hash.
If it is a hash then a new instance will be created passing the hash as the
opts parameter to the constructor.
2309 2310 2311 2312 2313 2314 |
# File 'lib/ovirtsdk4/types.rb', line 2309 def cpu_tune=(value) if value.is_a?(Hash) value = CpuTune.new(value) end @cpu_tune = value end |
#hash ⇒ Object
Generates a hash value for this object.
2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 |
# File 'lib/ovirtsdk4/types.rb', line 2489 def hash super + @architecture.hash + @cores.hash + @cpu_tune.hash + @level.hash + @mode.hash + @name.hash + @speed.hash + @topology.hash + @type.hash end |
#level ⇒ Integer
Returns the value of the level attribute.
2321 2322 2323 |
# File 'lib/ovirtsdk4/types.rb', line 2321 def level @level end |
#level=(value) ⇒ Object
Sets the value of the level attribute.
2330 2331 2332 |
# File 'lib/ovirtsdk4/types.rb', line 2330 def level=(value) @level = value end |
#mode ⇒ CpuMode
Returns the value of the mode attribute.
2339 2340 2341 |
# File 'lib/ovirtsdk4/types.rb', line 2339 def mode @mode end |
#mode=(value) ⇒ Object
Sets the value of the mode attribute.
2348 2349 2350 |
# File 'lib/ovirtsdk4/types.rb', line 2348 def mode=(value) @mode = value end |
#name ⇒ String
Returns the value of the name attribute.
2357 2358 2359 |
# File 'lib/ovirtsdk4/types.rb', line 2357 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name attribute.
2366 2367 2368 |
# File 'lib/ovirtsdk4/types.rb', line 2366 def name=(value) @name = value end |
#speed ⇒ Float
Returns the value of the speed attribute.
2375 2376 2377 |
# File 'lib/ovirtsdk4/types.rb', line 2375 def speed @speed end |
#speed=(value) ⇒ Object
Sets the value of the speed attribute.
2384 2385 2386 |
# File 'lib/ovirtsdk4/types.rb', line 2384 def speed=(value) @speed = value end |
#topology ⇒ CpuTopology
Returns the value of the topology attribute.
2393 2394 2395 |
# File 'lib/ovirtsdk4/types.rb', line 2393 def topology @topology end |
#topology=(value) ⇒ Object
Sets the value of the topology attribute.
The value parameter can be an instance of OvirtSDK4::CpuTopology or a hash.
If it is a hash then a new instance will be created passing the hash as the
opts parameter to the constructor.
2406 2407 2408 2409 2410 2411 |
# File 'lib/ovirtsdk4/types.rb', line 2406 def topology=(value) if value.is_a?(Hash) value = CpuTopology.new(value) end @topology = value end |
#type ⇒ String
Returns the value of the type attribute.
2418 2419 2420 |
# File 'lib/ovirtsdk4/types.rb', line 2418 def type @type end |
#type=(value) ⇒ Object
Sets the value of the type attribute.
2427 2428 2429 |
# File 'lib/ovirtsdk4/types.rb', line 2427 def type=(value) @type = value end |