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.
2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 |
# File 'lib/ovirtsdk4/types.rb', line 2374 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.
2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 |
# File 'lib/ovirtsdk4/types.rb', line 2390 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.
2169 2170 2171 |
# File 'lib/ovirtsdk4/types.rb', line 2169 def architecture @architecture end |
#architecture=(value) ⇒ Object
Sets the value of the architecture
attribute.
2178 2179 2180 |
# File 'lib/ovirtsdk4/types.rb', line 2178 def architecture=(value) @architecture = value end |
#cores ⇒ Array<Core>
Returns the value of the cores
attribute.
2187 2188 2189 |
# File 'lib/ovirtsdk4/types.rb', line 2187 def cores @cores end |
#cores=(list) ⇒ Object
Sets the value of the cores
attribute.
2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 |
# File 'lib/ovirtsdk4/types.rb', line 2196 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.
2213 2214 2215 |
# File 'lib/ovirtsdk4/types.rb', line 2213 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.
2226 2227 2228 2229 2230 2231 |
# File 'lib/ovirtsdk4/types.rb', line 2226 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.
2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 |
# File 'lib/ovirtsdk4/types.rb', line 2406 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.
2238 2239 2240 |
# File 'lib/ovirtsdk4/types.rb', line 2238 def level @level end |
#level=(value) ⇒ Object
Sets the value of the level
attribute.
2247 2248 2249 |
# File 'lib/ovirtsdk4/types.rb', line 2247 def level=(value) @level = value end |
#mode ⇒ CpuMode
Returns the value of the mode
attribute.
2256 2257 2258 |
# File 'lib/ovirtsdk4/types.rb', line 2256 def mode @mode end |
#mode=(value) ⇒ Object
Sets the value of the mode
attribute.
2265 2266 2267 |
# File 'lib/ovirtsdk4/types.rb', line 2265 def mode=(value) @mode = value end |
#name ⇒ String
Returns the value of the name
attribute.
2274 2275 2276 |
# File 'lib/ovirtsdk4/types.rb', line 2274 def name @name end |
#name=(value) ⇒ Object
Sets the value of the name
attribute.
2283 2284 2285 |
# File 'lib/ovirtsdk4/types.rb', line 2283 def name=(value) @name = value end |
#speed ⇒ Float
Returns the value of the speed
attribute.
2292 2293 2294 |
# File 'lib/ovirtsdk4/types.rb', line 2292 def speed @speed end |
#speed=(value) ⇒ Object
Sets the value of the speed
attribute.
2301 2302 2303 |
# File 'lib/ovirtsdk4/types.rb', line 2301 def speed=(value) @speed = value end |
#topology ⇒ CpuTopology
Returns the value of the topology
attribute.
2310 2311 2312 |
# File 'lib/ovirtsdk4/types.rb', line 2310 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.
2323 2324 2325 2326 2327 2328 |
# File 'lib/ovirtsdk4/types.rb', line 2323 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.
2335 2336 2337 |
# File 'lib/ovirtsdk4/types.rb', line 2335 def type @type end |
#type=(value) ⇒ Object
Sets the value of the type
attribute.
2344 2345 2346 |
# File 'lib/ovirtsdk4/types.rb', line 2344 def type=(value) @type = value end |