Class: Vte::Regex

Inherits:
Object
  • Object
show all
Defined in:
lib/vte4/regex.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern, compile_flags, options) ⇒ Regex

Returns a new instance of Regex.



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/vte4/regex.rb', line 20

def initialize(pattern, compile_flags, options)
  flags = parse_compile_flags(compile_flags)
  if options[:for_match]
    initialize_new_for_match(pattern, pattern.bytesize, flags)
  elsif options[:for_search]
    initialize_new_for_search(pattern, pattern.bytesize, flags)
  else
    raise(ArgumentError,
          "must specify usage :for_match or :for_search: #{options.inspect}")
  end
end

Instance Method Details

#initialize_rawObject



19
# File 'lib/vte4/regex.rb', line 19

alias_method :initialize_raw, :initialize