Sha256: 8bf689ad194f87a361901dd9c897599e82afdefcabe35d12b89a3ea94b2835d7

Contents?: true

Size: 387 Bytes

Versions: 6

Compression:

Stored size: 387 Bytes

Contents

# frozen_string_literal: true

module Wayfarer
  module Routing
    module Matchers
      class Custom
        include Stringify

        attr_reader :delegate

        def initialize(delegate = proc)
          @delegate = delegate
        end

        def match(url)
          !!delegate.call(url)
        end

        def params(_)
          {}
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wayfarer-0.4.7 lib/wayfarer/routing/matchers/custom.rb
wayfarer-0.4.6 lib/wayfarer/routing/matchers/custom.rb
wayfarer-0.4.5 lib/wayfarer/routing/matchers/custom.rb
wayfarer-0.4.4 lib/wayfarer/routing/matchers/custom.rb
wayfarer-0.4.3 lib/wayfarer/routing/matchers/custom.rb
wayfarer-0.4.2 lib/wayfarer/routing/matchers/custom.rb