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

#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_memory_clock_m_hz,
          min_bandwidth_g_bs,
          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