Module: Ruby::Rego::EnvironmentOverrides
- Included in:
- Environment
- Defined in:
- lib/ruby/rego/environment/overrides.rb
Overview
Provides temporary input/data overrides for the environment.
Constant Summary collapse
- UNSET =
Object.new.freeze
Instance Method Summary collapse
Instance Method Details
#with_overrides(input: UNSET, data: UNSET, data_paths: []) {|environment| ... } ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ruby/rego/environment/overrides.rb', line 17 def with_overrides(input: UNSET, data: UNSET, data_paths: []) original = [@input, @data, @overridden_data_paths] memoization.with_context do apply_overrides(input, data) @overridden_data_paths += data_paths yield self end ensure @input, @data, @overridden_data_paths = original end |