Class: JsRegex::Conversion

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

Overview

This class acts as a facade, passing a Regexp to the Converters.

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

Class Method Summary collapse

Class Method Details

.of(input, options: nil, target: Target::ES2009, fail_fast: false) ⇒ Object



16
17
18
19
20
21
# File 'lib/js_regex/conversion.rb', line 16

def of(input, options: nil, target: Target::ES2009, fail_fast: false)
  target                       = Target.cast(target)
  source, warnings, extra_opts = convert_source(input, target, fail_fast)
  options_string               = convert_options(input, options, extra_opts)
  [source, options_string, warnings, target]
end