Class: BBK::App::Matchers::Full
- Defined in:
- lib/bbk/app/matchers/full.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(*args) ⇒ Full
constructor
A new instance of Full.
- #match(headers, payload, delivery_info, *_args) ⇒ Object
Methods inherited from Base
#==, #eql?, #hash, #keys_deep, #match_impl
Constructor Details
#initialize(*args) ⇒ Full
Returns a new instance of Full.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bbk/app/matchers/full.rb', line 10 def initialize(*args) if args.size == 1 arg = args[0] hrule = arg.fetch(:headers, {}) prule = arg.fetch(:payload, {}) drule = arg.fetch(:delivery_info, {}) else hrule, prule, drule = *args end @hm = Headers.new(hrule) @pm = Payload.new(prule) @dm = DeliveryInfo.new(drule) @rule = [hrule, prule, drule] end |
Instance Method Details
#match(headers, payload, delivery_info, *_args) ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/bbk/app/matchers/full.rb', line 26 def match(headers, payload, delivery_info, *_args) return unless (hr = @hm.match(headers, payload, delivery_info)) return unless (pr = @pm.match(headers, payload, delivery_info)) return unless (dr = @dm.match(headers, payload, delivery_info)) [hr, pr, dr] rescue StandardError nil end |