Class: Runbox::SetupResult
- Inherits:
-
Object
- Object
- Runbox::SetupResult
- Defined in:
- lib/runbox/setup_result.rb
Instance Attribute Summary collapse
-
#cached ⇒ Object
readonly
Returns the value of attribute cached.
-
#container_id ⇒ Object
readonly
Returns the value of attribute container_id.
-
#environment_snapshot ⇒ Object
readonly
Returns the value of attribute environment_snapshot.
Instance Method Summary collapse
- #cached? ⇒ Boolean
-
#initialize(data) ⇒ SetupResult
constructor
A new instance of SetupResult.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ SetupResult
Returns a new instance of SetupResult.
7 8 9 10 11 12 13 |
# File 'lib/runbox/setup_result.rb', line 7 def initialize(data) @container_id = data["container_id"] || data[:container_id] @cached = data["cached"] || data[:cached] || false @environment_snapshot = EnvironmentSnapshot.new( data["environment_snapshot"] || data[:environment_snapshot] || {} ) end |
Instance Attribute Details
#cached ⇒ Object (readonly)
Returns the value of attribute cached.
5 6 7 |
# File 'lib/runbox/setup_result.rb', line 5 def cached @cached end |
#container_id ⇒ Object (readonly)
Returns the value of attribute container_id.
5 6 7 |
# File 'lib/runbox/setup_result.rb', line 5 def container_id @container_id end |
#environment_snapshot ⇒ Object (readonly)
Returns the value of attribute environment_snapshot.
5 6 7 |
# File 'lib/runbox/setup_result.rb', line 5 def environment_snapshot @environment_snapshot end |
Instance Method Details
#cached? ⇒ Boolean
15 16 17 |
# File 'lib/runbox/setup_result.rb', line 15 def cached? @cached == true end |
#to_h ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/runbox/setup_result.rb', line 19 def to_h { container_id: @container_id, cached: @cached, environment_snapshot: @environment_snapshot.to_h } end |