Sha256: 878b3007396453c3e026f7db0a4510c0841da9ffe5eb24b4615ca20214895d5d

Contents?: true

Size: 592 Bytes

Versions: 23

Compression:

Stored size: 592 Bytes

Contents

module Regexp::Expression

  class Quantifier
    attr_reader   :token, :text, :min, :max, :mode

    def initialize(token, text, min, max, mode)
      @token = token
      @text  = text
      @mode  = mode
      @min   = min
      @max   = max
    end

    def clone
      copy = self.dup
      copy.instance_variable_set(:@text, @text.dup)
      copy
    end

    def to_s
      @text.dup
    end
    alias :to_str :to_s

    def to_h
      {
        :token => token,
        :text  => text,
        :mode  => mode,
        :min   =>  min,
        :max   =>  max
      }
    end
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
regexp_parser-0.4.13 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.12 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.11 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.10 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.9 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.8 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.7 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.6 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.5 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.4 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.3 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.2 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.1 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.4.0 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.6 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.5 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.4 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.3 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.2 lib/regexp_parser/expression/quantifier.rb
regexp_parser-0.3.1 lib/regexp_parser/expression/quantifier.rb