Class: Playwright::JavaScript::Regex

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ Regex

Returns a new instance of Regex.



4
5
6
7
8
9
10
11
# File 'lib/playwright/javascript/regex.rb', line 4

def initialize(regexp)
  unless regexp.is_a?(Regexp)
    raise ArgumentError("Argument must be a Regexp: #{regexp} (#{regexp.class})")
  end

  @source = regexp.source
  @flag = flag_for(regexp)
end

Instance Attribute Details

#flagObject (readonly)

Returns the value of attribute flag.



13
14
15
# File 'lib/playwright/javascript/regex.rb', line 13

def flag
  @flag
end

#sourceObject (readonly)

Returns the value of attribute source.



13
14
15
# File 'lib/playwright/javascript/regex.rb', line 13

def source
  @source
end