Sha256: 1f96efc9f00a76f1c95276c9fcb2f7a2d498e7398d2325cfb12288fe9cf1f61d

Contents?: true

Size: 535 Bytes

Versions: 13

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

require_relative '../value_equality'

module Shivers
  module Parts
    class Static
      include ValueEquality

      def initialize(data)
        @value = data[:value]
      end

      def matcher
        /#{Regexp.quote(@value)}/
      end

      def convert(value)
        value
      end

      def merge(_, second)
        second
      end

      def capturable?
        false
      end

      def multivalued?
        false
      end

      def state
        [@value]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
shivers-0.6.0.pre.15 lib/shivers/parts/static.rb
shivers-0.6.0.pre.14 lib/shivers/parts/static.rb
shivers-0.6.0.pre.13 lib/shivers/parts/static.rb
shivers-0.6.0.pre.12 lib/shivers/parts/static.rb
shivers-0.6.0.pre.11 lib/shivers/parts/static.rb
shivers-0.6.0.pre.10 lib/shivers/parts/static.rb
shivers-0.6.0.pre.9 lib/shivers/parts/static.rb
shivers-0.6.0.pre.8 lib/shivers/parts/static.rb
shivers-0.6.0.pre.7 lib/shivers/parts/static.rb
shivers-0.6.0.pre.6 lib/shivers/parts/static.rb
shivers-0.6.0.pre.5 lib/shivers/parts/static.rb
shivers-0.6.0.pre.4 lib/shivers/parts/static.rb
shivers-0.6.0.pre.3 lib/shivers/parts/static.rb