Sha256: e7654df396ac014e39c8226c7e409d3d44a145ad445af9a3b5b61614d9e3fd1a

Contents?: true

Size: 467 Bytes

Versions: 22

Compression:

Stored size: 467 Bytes

Contents

require 'bbk/app/matchers/base'

module BBK
  module App
    module Matchers
      class Payload < Base

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

        def match(_headers, payload, _delivery_info = nil, *_args)
          payload = JSON(payload) if payload&.is_a?(String)
          match_impl(@rule, payload.with_indifferent_access)
        rescue StandardError
          nil
        end

      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bbk-app-1.0.0.72917 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.72899 lib/bbk/app/matchers/payload.rb