Sha256: e7654df396ac014e39c8226c7e409d3d44a145ad445af9a3b5b61614d9e3fd1a

Contents?: true

Size: 467 Bytes

Versions: 23

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

23 entries across 23 versions & 1 rubygems

Version Path
bbk-app-1.1.1.276745 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.1.273627 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.1.273338 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.1.273312 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.1.273294 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.219406 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.216998 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.204569 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.200751 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.200186 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.199675 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.199604 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.199389 lib/bbk/app/matchers/payload.rb
bbk-app-1.1.0.199383 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.152254 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.141716 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.80957 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.79514 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.79241 lib/bbk/app/matchers/payload.rb
bbk-app-1.0.0.78020 lib/bbk/app/matchers/payload.rb