Class: TurkishRegexps::TrRegexp

Inherits:
Object
  • Object
show all
Defined in:
lib/turkish_regexps/tr_regexp.rb

Overview

Let your regexps to speak in Turkish

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ TrRegexp

A new instance of TrRegexp

Parameters:

  • pattern (Regexp)


10
11
12
13
14
# File 'lib/turkish_regexps/tr_regexp.rb', line 10

def initialize(pattern)
  @source = pattern.source
  @options = pattern.options
  @casefold = pattern.casefold?
end

Instance Method Details

#translateRegexp

Translate regexps into Turkish supported version

Returns:

  • (Regexp)


19
20
21
22
23
# File 'lib/turkish_regexps/tr_regexp.rb', line 19

def translate
  translate_matches
  add_meta_charset
  set_encoding
end