Class: Verizon::Gpu

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/gpu.rb

Overview

GPU resources of a service profile.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_bsInteger

Minimum GPU bandwidth in GB/s.

Returns:

  • (Integer)


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_hzInteger

Minimum Core Clock value in megahertz.

Returns:

  • (Integer)


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_hzInteger

Minimum Memory Clock value in megahertz.

Returns:

  • (Integer)


18
19
20
# File 'lib/verizon/models/gpu.rb', line 18

def min_memory_clock_m_hz
  @min_memory_clock_m_hz
end

#min_tflopsInteger

Minimum Floating Point Operations Per Second in Teraflops.

Returns:

  • (Integer)


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

.namesObject

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

.nullablesObject

An array for nullable fields



49
50
51
# File 'lib/verizon/models/gpu.rb', line 49

def self.nullables
  []
end

.optionalsObject

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

#inspectObject

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_sObject

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