Sha256: a31a9cf784d2a667199d370c89055e48814e6bb71fd2587e84de886dbd25761b

Contents?: true

Size: 300 Bytes

Versions: 1

Compression:

Stored size: 300 Bytes

Contents

module Dry
  class Matcher
    class Case
      def initialize(match:, resolve:)
        @match = match
        @resolve = resolve
      end

      def matches?(value, *pattern)
        @match.(value, *pattern)
      end

      def resolve(value)
        @resolve.(value)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dry-matcher-0.5.0 lib/dry/matcher/case.rb