Class: Verizon::GPU
- Defined in:
- lib/verizon/models/gpu.rb
Overview
GPU resources of a service profile.
Instance Attribute Summary collapse
-
#min_bandwidth_g_bs ⇒ Integer
Minimum GPU bandwidth in GB/s.
-
#min_core_clock_m_hz ⇒ Integer
Minimum Core Clock value in megahertz.
-
#min_memory_clock_m_hz ⇒ Integer
Minimum Memory Clock value in megahertz.
-
#min_tflops ⇒ Integer
Minimum Floating Point Operations Per Second in Teraflops.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(min_core_clock_m_hz = SKIP, min_memory_clock_m_hz = SKIP, min_bandwidth_g_bs = SKIP, min_tflops = SKIP) ⇒ GPU
constructor
A new instance of GPU.
Methods inherited from BaseModel
Constructor Details
#initialize(min_core_clock_m_hz = SKIP, min_memory_clock_m_hz = SKIP, min_bandwidth_g_bs = SKIP, min_tflops = SKIP) ⇒ GPU
Returns a new instance of GPU.
53 54 55 56 57 58 59 |
# File 'lib/verizon/models/gpu.rb', line 53 def initialize(min_core_clock_m_hz = SKIP, min_memory_clock_m_hz = SKIP, min_bandwidth_g_bs = SKIP, min_tflops = SKIP) @min_core_clock_m_hz = min_core_clock_m_hz unless min_core_clock_m_hz == SKIP @min_memory_clock_m_hz = min_memory_clock_m_hz unless min_memory_clock_m_hz == SKIP @min_bandwidth_g_bs = min_bandwidth_g_bs unless min_bandwidth_g_bs == SKIP @min_tflops = min_tflops unless min_tflops == SKIP end |
Instance Attribute Details
#min_bandwidth_g_bs ⇒ Integer
Minimum GPU bandwidth in GB/s.
22 23 24 |
# File 'lib/verizon/models/gpu.rb', line 22 def min_bandwidth_g_bs @min_bandwidth_g_bs end |
#min_core_clock_m_hz ⇒ Integer
Minimum Core Clock value in megahertz.
14 15 16 |
# File 'lib/verizon/models/gpu.rb', line 14 def min_core_clock_m_hz @min_core_clock_m_hz end |
#min_memory_clock_m_hz ⇒ Integer
Minimum Memory Clock value in megahertz.
18 19 20 |
# File 'lib/verizon/models/gpu.rb', line 18 def min_memory_clock_m_hz @min_memory_clock_m_hz end |
#min_tflops ⇒ Integer
Minimum Floating Point Operations Per Second in Teraflops.
26 27 28 |
# File 'lib/verizon/models/gpu.rb', line 26 def min_tflops @min_tflops end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/verizon/models/gpu.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. min_core_clock_m_hz = hash.key?('minCoreClockMHz') ? hash['minCoreClockMHz'] : SKIP min_memory_clock_m_hz = hash.key?('minMemoryClockMHz') ? hash['minMemoryClockMHz'] : SKIP min_bandwidth_g_bs = hash.key?('minBandwidthGBs') ? hash['minBandwidthGBs'] : SKIP min_tflops = hash.key?('minTFLOPS') ? hash['minTFLOPS'] : SKIP # Create object from extracted values. GPU.new(min_core_clock_m_hz, min_memory_clock_m_hz, min_bandwidth_g_bs, min_tflops) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/verizon/models/gpu.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['min_core_clock_m_hz'] = 'minCoreClockMHz' @_hash['min_memory_clock_m_hz'] = 'minMemoryClockMHz' @_hash['min_bandwidth_g_bs'] = 'minBandwidthGBs' @_hash['min_tflops'] = 'minTFLOPS' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/verizon/models/gpu.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/verizon/models/gpu.rb', line 39 def self.optionals %w[ min_core_clock_m_hz min_memory_clock_m_hz min_bandwidth_g_bs min_tflops ] end |