Class: OpenSandbox::Sandbox
- Inherits:
-
Data
- Object
- Data
- OpenSandbox::Sandbox
- Defined in:
- lib/open_sandbox/models.rb
Overview
Value object for a Sandbox resource
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#entrypoint ⇒ Object
readonly
Returns the value of attribute entrypoint.
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image_uri ⇒ Object
readonly
Returns the value of attribute image_uri.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def created_at @created_at end |
#entrypoint ⇒ Object (readonly)
Returns the value of attribute entrypoint
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def entrypoint @entrypoint end |
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def expires_at @expires_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def id @id end |
#image_uri ⇒ Object (readonly)
Returns the value of attribute image_uri
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def image_uri @image_uri end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def @metadata end |
#status ⇒ Object (readonly)
Returns the value of attribute status
37 38 39 |
# File 'lib/open_sandbox/models.rb', line 37 def status @status end |
Class Method Details
.from_hash(h) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/open_sandbox/models.rb', line 38 def self.from_hash(h) new( id: h["id"], status: SandboxStatus.from_hash(h["status"]), image_uri: h.dig("image", "uri"), entrypoint: h["entrypoint"] || [], metadata: h["metadata"] || {}, expires_at: h["expiresAt"] ? Time.parse(h["expiresAt"]) : nil, created_at: h["createdAt"] ? Time.parse(h["createdAt"]) : nil ) end |