Sha256: c246eb261551f770ef1dc7af32a9be2819e25e59a9210c7adc54cfac5dc0d689
Contents?: true
Size: 772 Bytes
Versions: 13
Compression:
Stored size: 772 Bytes
Contents
# frozen_string_literal: true require 'cased/sensitive/range' module Cased module Sensitive class String < String attr_reader :label attr_reader :string def initialize(string, label: nil) super(string) @label = label end def range(key:) Cased::Sensitive::Range.new( label: label, key: key, begin_offset: 0, end_offset: length, ) end def matches(regex) offset = 0 matches = [] while (result = match(regex, offset)) matches.push(result) offset = result.end(0) end matches end def ==(other) super(other) && @label == other.label end end end end
Version data entries
13 entries across 13 versions & 1 rubygems