blob: 39826a9401f48d0711c533adcc94e1e92447fe4c (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# frozen_string_literal: true
require_relative 'fetch'
module NanoBot
module Logic
module Cartridge
module Safety
def self.default_answer(cartridge)
default = Fetch.cascate(cartridge, [%i[interfaces tools confirming default]])
return [] if default.nil?
default
end
def self.yeses(cartridge)
yeses_values = Fetch.cascate(cartridge, [%i[interfaces tools confirming yeses]])
return [] if yeses_values.nil?
yeses_values
end
def self.confirmable?(cartridge)
confirmable = Fetch.cascate(cartridge, [%i[safety tools confirmable]])
return true if confirmable.nil?
confirmable
end
def self.sandboxed?(cartridge)
sandboxed = Fetch.cascate(cartridge, [%i[safety functions sandboxed]])
return true if sandboxed.nil?
sandboxed
end
end
end
end
end
|