Class: BBK::App::Matchers::Headers

Inherits:
Base
  • Object
show all
Defined in:
lib/bbk/app/matchers/headers.rb

Instance Attribute Summary

Attributes inherited from Base

#rule

Instance Method Summary collapse

Methods inherited from Base

#==, #eql?, #hash, #keys_deep, #match_impl

Constructor Details

#initialize(rule) ⇒ Headers

Returns a new instance of Headers.



8
9
10
# File 'lib/bbk/app/matchers/headers.rb', line 8

def initialize(rule)
  @rule = rule.with_indifferent_access
end

Instance Method Details

#match(headers, _payload = nil, _delivery_info = nil, *_args) ⇒ Object



12
13
14
15
16
# File 'lib/bbk/app/matchers/headers.rb', line 12

def match(headers, _payload = nil, _delivery_info = nil, *_args)
  match_impl(@rule, headers.with_indifferent_access)
rescue StandardError
  nil
end