Class: Vanguard::Matcher::Nullary::Format::Regexp

Inherits:
Vanguard::Matcher::Nullary::Format show all
Defined in:
lib/vanguard/matcher/nullary/format.rb

Overview

Matcher for regexps

Constant Summary

Constants inherited from Vanguard::Matcher::Nullary::Format

EMAIL_ADDRESS, EMAIL_ADDRESS_REGEXP, URL, URL_REGEXP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Vanguard::Matcher::Nullary::Format

build

Instance Attribute Details

#regexpRegexp (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return regexp

Returns:



18
19
20
# File 'lib/vanguard/matcher/nullary/format.rb', line 18

def regexp
  @regexp
end

Instance Method Details

#matches?(input) ⇒ true, false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if input matches regexp

Parameters:

  • input (String)

Returns:

  • (true)

    if input matches regexp

  • (false)

    otherwise



32
33
34
# File 'lib/vanguard/matcher/nullary/format.rb', line 32

def matches?(input)
  !!(regexp =~ input)
end