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.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
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_core_clock_m_hz, min_memory_clock_m_hz: min_memory_clock_m_hz, min_bandwidth_g_bs: min_bandwidth_g_bs, min_tflops: 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 |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
90 91 92 93 94 95 |
# File 'lib/verizon/models/gpu.rb', line 90 def inspect class_name = self.class.name.split('::').last "<#{class_name} min_core_clock_m_hz: #{@min_core_clock_m_hz.inspect},"\ " min_memory_clock_m_hz: #{@min_memory_clock_m_hz.inspect}, min_bandwidth_g_bs:"\ " #{@min_bandwidth_g_bs.inspect}, min_tflops: #{@min_tflops.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
82 83 84 85 86 87 |
# File 'lib/verizon/models/gpu.rb', line 82 def to_s class_name = self.class.name.split('::').last "<#{class_name} min_core_clock_m_hz: #{@min_core_clock_m_hz}, min_memory_clock_m_hz:"\ " #{@min_memory_clock_m_hz}, min_bandwidth_g_bs: #{@min_bandwidth_g_bs}, min_tflops:"\ " #{@min_tflops}>" end |