class Regexy::RegexpWithMode

Public Class Methods

new(mode = default_mode, *args) click to toggle source
Calls superclass method Regexy::Regexp::new
# File lib/regexy/regexp.rb, line 81
def initialize(mode = default_mode, *args)
  regexp = regexp_for(mode.to_sym)
  fail ArgumentError, "Unknown mode #{mode.to_s}" unless regexp
  super(regexp, *args)
end

Protected Instance Methods

default_mode() click to toggle source
# File lib/regexy/regexp.rb, line 93
def default_mode
  :normal
end
regexp_for(mode) click to toggle source
# File lib/regexy/regexp.rb, line 89
def regexp_for(mode)
  fail NotImplementedError, 'Child classes should override #regexp_for method'
end