Class: Siftly::Checker
- Inherits:
-
Object
- Object
- Siftly::Checker
- Defined in:
- lib/siftly/checker.rb
Instance Method Summary collapse
- #call(value:, attribute: nil, record: nil, context: {}, filters: nil, filter_overrides: {}, aggregator: nil, threshold: nil, failure_mode: nil, instrumenter: nil) ⇒ Object
-
#initialize(config:) ⇒ Checker
constructor
A new instance of Checker.
Constructor Details
#initialize(config:) ⇒ Checker
Returns a new instance of Checker.
5 6 7 |
# File 'lib/siftly/checker.rb', line 5 def initialize(config:) @config = config end |
Instance Method Details
#call(value:, attribute: nil, record: nil, context: {}, filters: nil, filter_overrides: {}, aggregator: nil, threshold: nil, failure_mode: nil, instrumenter: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/siftly/checker.rb', line 9 def call( value:, attribute: nil, record: nil, context: {}, filters: nil, filter_overrides: {}, aggregator: nil, threshold: nil, failure_mode: nil, instrumenter: nil ) active_filters = resolve_filters(filters) runtime_filter_configs = build_filter_configs(active_filters, filter_overrides) Pipeline.new( filter_keys: active_filters, filter_configs: runtime_filter_configs, aggregator: aggregator || config.aggregator, threshold: threshold || config.threshold, failure_mode: failure_mode || config.failure_mode, instrumenter: instrumenter || config.instrumenter ).call(value: value, attribute: attribute, record: record, context: context) end |