Module: RegexpPropertyValues::Value::ExtAdapter

Included in:
RegexpPropertyValues::Value
Defined in:
lib/regexp_property_values/value/ext_adapter.rb

Instance Method Summary collapse

Instance Method Details

#matched_charactersObject



4
5
6
# File 'lib/regexp_property_values/value/ext_adapter.rb', line 4

def matched_characters
  matched_codepoints.map { |cp| cp.chr('utf-8') }
end

#matched_codepointsObject



8
9
10
# File 'lib/regexp_property_values/value/ext_adapter.rb', line 8

def matched_codepoints
  matched_ranges.flat_map(&:to_a)
end

#matched_rangesObject



12
13
14
15
16
# File 'lib/regexp_property_values/value/ext_adapter.rb', line 12

def matched_ranges
  OnigRegexpPropertyHelper.matched_ranges(name)
rescue ArgumentError
  raise_unsupported_or_unknown_error
end