Class: Kward::Sandbox::Capabilities
- Inherits:
-
Object
- Object
- Kward::Sandbox::Capabilities
- Defined in:
- lib/kward/sandbox/capabilities.rb
Overview
Describes the enforcement a platform runner can provide.
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #available? ⇒ Boolean
- #child_network_enforced? ⇒ Boolean
- #filesystem_enforced? ⇒ Boolean
-
#initialize(available:, filesystem_enforced:, child_network_enforced:, backend:, reason: nil) ⇒ Capabilities
constructor
A new instance of Capabilities.
- #to_h ⇒ Object
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
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
6 7 8 |
# File 'lib/kward/sandbox/capabilities.rb', line 6 def backend @backend end |
#reason ⇒ Object (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
16 17 18 |
# File 'lib/kward/sandbox/capabilities.rb', line 16 def available? @available end |
#child_network_enforced? ⇒ Boolean
24 25 26 |
# File 'lib/kward/sandbox/capabilities.rb', line 24 def child_network_enforced? @child_network_enforced end |
#filesystem_enforced? ⇒ Boolean
20 21 22 |
# File 'lib/kward/sandbox/capabilities.rb', line 20 def filesystem_enforced? @filesystem_enforced end |
#to_h ⇒ Object
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 |