Class: OvirtSDK4::Cpu
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
true
ifself
andother
have the same attributes and values. -
#architecture ⇒ Architecture
Returns the value of the
architecture
attribute. -
#architecture=(value) ⇒ Object
Sets the value of the
architecture
attribute. -
#cores ⇒ Array<Core>
Returns the value of the
cores
attribute. -
#cores=(list) ⇒ Object
Sets the value of the
cores
attribute. -
#cpu_tune ⇒ CpuTune
Returns the value of the
cpu_tune
attribute. -
#cpu_tune=(value) ⇒ Object
Sets the value of the
cpu_tune
attribute. -
#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
level
attribute. -
#level=(value) ⇒ Object
Sets the value of the
level
attribute. -
#mode ⇒ CpuMode
Returns the value of the
mode
attribute. -
#mode=(value) ⇒ Object
Sets the value of the
mode
attribute. -
#name ⇒ String
Returns the value of the
name
attribute. -
#name=(value) ⇒ Object
Sets the value of the
name
attribute. -
#speed ⇒ Float
Returns the value of the
speed
attribute. -
#speed=(value) ⇒ Object
Sets the value of the
speed
attribute. -
#topology ⇒ CpuTopology
Returns the value of the
topology
attribute. -
#topology=(value) ⇒ Object
Sets the value of the
topology
attribute. -
#type ⇒ String
Returns the value of the
type
attribute. -
#type=(value) ⇒ Object
Sets the value of the
type
attribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ Cpu
Creates a new instance of the OvirtSDK4::Cpu class.
2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 |
# File 'lib/ovirtsdk4/types.rb', line 2424 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.
2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 |
# File 'lib/ovirtsdk4/types.rb', line 2440 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.
2219 2220 2221 |
# File 'lib/ovirtsdk4/types.rb', line 2219 def architecture @architecture end |
#architecture=(value) ⇒ Object
Sets the value of the architecture
attribute.
2228 2229 2230 |
# File 'lib/ovirtsdk4/types.rb', line 2228 def architecture=(value) @architecture = value end |
#cores ⇒ Array<Core>
Returns the value of the cores
attribute.
2237 2238 2239 |
# File 'lib/ovirtsdk4/types.rb', line 2237 def cores @cores end |
#cores=(list) ⇒ Object
Sets the value of the cores
attribute.
2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 |
# File 'lib/ovirtsdk4/types.rb', line 2246 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.
2263 2264 2265 |
# File 'lib/ovirtsdk4/types.rb', line 2263 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.
2276 2277 2278 2279 2280 2281 |
# File 'lib/ovirtsdk4/types.rb', line 2276 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.
2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 |
# File 'lib/ovirtsdk4/types.rb', line 2456 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.
2288 2289 2290 |
# File 'lib/ovirtsdk4/types.rb', line 2288 def level @level end |
#level=(value) ⇒ Object
Sets the value of the level
attribute.
2297 2298 2299 |
# File 'lib/ovirtsdk4/types.rb', line 2297 def level=(value) @level = value end |
#mode ⇒ CpuMode
Returns the value of the mode
attribute.
2306 2307 2308 |
# File 'lib/ovirtsdk4/types.rb', line 2306 def mode @mode end |
#mode=(value) ⇒ Object
Sets the value of the mode
attribute.
2315 2316 2317 |
# File 'lib/ovirtsdk4/types.rb', line 2315 def mode=(value) @mode = value end |
#name ⇒ String
Returns the value of the name
attribute.
2324 2325 2326 |
# File 'lib/ovirtsdk4/types.rb', line 2324 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
2333 2334 2335 |
# File 'lib/ovirtsdk4/types.rb', line 2333 def name=(value) @name = value end |
#speed ⇒ Float
Returns the value of the speed
attribute.
2342 2343 2344 |
# File 'lib/ovirtsdk4/types.rb', line 2342 def speed @speed end |
#speed=(value) ⇒ Object
Sets the value of the speed
attribute.
2351 2352 2353 |
# File 'lib/ovirtsdk4/types.rb', line 2351 def speed=(value) @speed = value end |
#topology ⇒ CpuTopology
Returns the value of the topology
attribute.
2360 2361 2362 |
# File 'lib/ovirtsdk4/types.rb', line 2360 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.
2373 2374 2375 2376 2377 2378 |
# File 'lib/ovirtsdk4/types.rb', line 2373 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.
2385 2386 2387 |
# File 'lib/ovirtsdk4/types.rb', line 2385 def type @type end |
#type=(value) ⇒ Object
Sets the value of the type
attribute.
2394 2395 2396 |
# File 'lib/ovirtsdk4/types.rb', line 2394 def type=(value) @type = value end |