Class: JsRegex::Conversion

Inherits:
Object
  • Object
show all
Defined in:
lib/js_regex/conversion.rb

Overview

This class acts as a facade, passing a regex to the converters.

::of returns a source String, options String, and warnings Array.

Class Method Summary collapse

Class Method Details

.of(ruby_regex, options: nil) ⇒ Object



14
15
16
17
18
# File 'lib/js_regex/conversion.rb', line 14

def of(ruby_regex, options: nil)
  source, warnings = convert_source(ruby_regex)
  options_string   = convert_options(ruby_regex, options)
  [source, options_string, warnings]
end