Class: Daytona::Resources
- Inherits:
-
Object
- Object
- Daytona::Resources
- Defined in:
- lib/daytona/common/resources.rb
Instance Attribute Summary collapse
-
#cpu ⇒ Integer?
readonly
Number of CPU cores to allocate.
-
#disk ⇒ Integer?
readonly
Amount of disk space in GiB to allocate.
-
#gpu ⇒ Integer?
readonly
Number of GPUs to allocate.
-
#memory ⇒ Integer?
readonly
Amount of memory in GiB to allocate.
Instance Method Summary collapse
-
#initialize(cpu: nil, memory: nil, disk: nil, gpu: nil) ⇒ Resources
constructor
A new instance of Resources.
-
#to_h ⇒ Hash
Hash representation of the resources.
Constructor Details
#initialize(cpu: nil, memory: nil, disk: nil, gpu: nil) ⇒ Resources
Returns a new instance of Resources.
21 22 23 24 25 26 |
# File 'lib/daytona/common/resources.rb', line 21 def initialize(cpu: nil, memory: nil, disk: nil, gpu: nil) @cpu = cpu @memory = memory @disk = disk @gpu = gpu end |
Instance Attribute Details
#cpu ⇒ Integer? (readonly)
Returns Number of CPU cores to allocate.
6 7 8 |
# File 'lib/daytona/common/resources.rb', line 6 def cpu @cpu end |
#disk ⇒ Integer? (readonly)
Returns Amount of disk space in GiB to allocate.
12 13 14 |
# File 'lib/daytona/common/resources.rb', line 12 def disk @disk end |
#gpu ⇒ Integer? (readonly)
Returns Number of GPUs to allocate.
15 16 17 |
# File 'lib/daytona/common/resources.rb', line 15 def gpu @gpu end |
#memory ⇒ Integer? (readonly)
Returns Amount of memory in GiB to allocate.
9 10 11 |
# File 'lib/daytona/common/resources.rb', line 9 def memory @memory end |
Instance Method Details
#to_h ⇒ Hash
Returns Hash representation of the resources.
29 |
# File 'lib/daytona/common/resources.rb', line 29 def to_h = { cpu:, memory:, disk:, gpu: }.compact |