Module: BBK::App::Matchers

Defined in:
lib/bbk/app/matchers.rb,
lib/bbk/app/matchers/base.rb,
lib/bbk/app/matchers/full.rb,
lib/bbk/app/matchers/headers.rb,
lib/bbk/app/matchers/payload.rb,
lib/bbk/app/matchers/delivery_info.rb

Defined Under Namespace

Classes: Base, DeliveryInfo, Full, Headers, Payload

Class Method Summary collapse

Class Method Details

.create(type, *args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/bbk/app/matchers.rb', line 10

def self.create(type, *args)
  case type
  when :meta, :headers
    Headers.new(args.first)
  when :payload
    Payload.new(args.first)
  when :delivery, :delivery_info
    DeliveryInfo.new(args.first)
  when :full
    Full.new(*args)
  else
    raise "there is no such matcher: #{type}"
  end
end