Class: Runbox::SetupResult

Inherits:
Object
  • Object
show all
Defined in:
lib/runbox/setup_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cachedObject (readonly)

Returns the value of attribute cached.



5
6
7
# File 'lib/runbox/setup_result.rb', line 5

def cached
  @cached
end

#container_idObject (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_snapshotObject (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

Returns:



15
16
17
# File 'lib/runbox/setup_result.rb', line 15

def cached?
  @cached == true
end

#to_hObject



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