Class: AgentJail::Configuration
- Inherits:
-
Object
- Object
- AgentJail::Configuration
- Defined in:
- lib/agent_jail/configuration.rb
Constant Summary collapse
- VALID_ON_UNSUPPORTED =
%i[warn raise ignore].freeze
Instance Attribute Summary collapse
-
#default_fs_allow ⇒ Object
Returns the value of attribute default_fs_allow.
-
#default_memory_mb ⇒ Object
Returns the value of attribute default_memory_mb.
-
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
-
#on_unsupported ⇒ Object
Returns the value of attribute on_unsupported.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 |
# File 'lib/agent_jail/configuration.rb', line 9 def initialize @default_timeout = 30 @default_memory_mb = 512 @default_fs_allow = [] @on_unsupported = :warn end |
Instance Attribute Details
#default_fs_allow ⇒ Object
Returns the value of attribute default_fs_allow.
7 8 9 |
# File 'lib/agent_jail/configuration.rb', line 7 def default_fs_allow @default_fs_allow end |
#default_memory_mb ⇒ Object
Returns the value of attribute default_memory_mb.
7 8 9 |
# File 'lib/agent_jail/configuration.rb', line 7 def default_memory_mb @default_memory_mb end |
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
7 8 9 |
# File 'lib/agent_jail/configuration.rb', line 7 def default_timeout @default_timeout end |
#on_unsupported ⇒ Object
Returns the value of attribute on_unsupported.
7 8 9 |
# File 'lib/agent_jail/configuration.rb', line 7 def on_unsupported @on_unsupported end |
Instance Method Details
#validate! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/agent_jail/configuration.rb', line 16 def validate! return if VALID_ON_UNSUPPORTED.include?(@on_unsupported) raise ArgumentError, "on_unsupported must be one of #{VALID_ON_UNSUPPORTED.inspect}, got #{@on_unsupported.inspect}" end |