Sha256: 51072d3f89c1afd8d7a66a55c69f1bf2eac1456552f17c9d930661d9dea2a1ce

Contents?: true

Size: 358 Bytes

Versions: 2

Compression:

Stored size: 358 Bytes

Contents

# frozen_string_literal: true

module Fear
  module Extractor
    # Match against array splat, and capture rest of an array
    # E.g. +[1, 2, *tail]+
    #
    class NamedArraySplatMatcher < ArraySplatMatcher
      # @!attribute name
      #   @return [Types::Strict::Symbol]

      def bindings(other)
        { name => other }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fear-1.2.0 lib/fear/extractor/named_array_splat_matcher.rb
fear-1.1.0 lib/fear/extractor/named_array_splat_matcher.rb