Skip to content
Kward Search API index

Class: Kward::Sandbox::Capabilities

Inherits:
Object
  • Object
show all
Defined in:
lib/kward/sandbox/capabilities.rb

Overview

Describes the enforcement a platform runner can provide.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(available:, filesystem_enforced:, child_network_enforced:, backend:, reason: nil) ⇒ Capabilities

Returns a new instance of Capabilities.



8
9
10
11
12
13
14
# File 'lib/kward/sandbox/capabilities.rb', line 8

def initialize(available:, filesystem_enforced:, child_network_enforced:, backend:, reason: nil)
  @available = available == true
  @filesystem_enforced = filesystem_enforced == true
  @child_network_enforced = child_network_enforced == true
  @backend = backend.to_s
  @reason = reason&.to_s
end

Instance Attribute Details

#backendObject (readonly)

Returns the value of attribute backend.



6
7
8
# File 'lib/kward/sandbox/capabilities.rb', line 6

def backend
  @backend
end

#reasonObject (readonly)

Returns the value of attribute reason.



6
7
8
# File 'lib/kward/sandbox/capabilities.rb', line 6

def reason
  @reason
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/kward/sandbox/capabilities.rb', line 16

def available?
  @available
end

#child_network_enforced?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/kward/sandbox/capabilities.rb', line 24

def child_network_enforced?
  @child_network_enforced
end

#filesystem_enforced?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/kward/sandbox/capabilities.rb', line 20

def filesystem_enforced?
  @filesystem_enforced
end

#to_hObject



28
29
30
31
32
33
34
35
36
# File 'lib/kward/sandbox/capabilities.rb', line 28

def to_h
  {
    available: available?,
    filesystemEnforced: filesystem_enforced?,
    childNetworkEnforced: child_network_enforced?,
    backend: backend,
    reason: reason
  }.compact
end