Module: Olyx::Guardrails::Rails::ConfigurationValues
- Defined in:
- lib/olyx/guardrails/rails/configuration_values.rb
Overview
Normalizes individual Rails configuration values before boot freezes.
Class Method Summary collapse
Class Method Details
.filter_parameters(value) ⇒ Object
26 27 28 |
# File 'lib/olyx/guardrails/rails/configuration_values.rb', line 26 def filter_parameters(value) FilterParameters.call(value) end |
.path(value) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/olyx/guardrails/rails/configuration_values.rb', line 19 def path(value) normalized = value.respond_to?(:to_path) ? value.to_path : value return normalized.dup.freeze if normalized.is_a?(String) && !normalized.empty? raise ArgumentError, 'Rails policy_path must be a path-like value' end |
.policy(value) ⇒ Object
13 14 15 16 17 |
# File 'lib/olyx/guardrails/rails/configuration_values.rb', line 13 def policy(value) return value if value.is_a?(Policy) raise ArgumentError, 'Rails policy must be an Olyx::Guardrails::Policy' end |