Class: PVN::OptionRegexpMatch

Inherits:
OptionMatch show all
Defined in:
lib/synoption/match.rb

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ OptionRegexpMatch

Returns a new instance of OptionRegexpMatch.



39
40
41
# File 'lib/synoption/match.rb', line 39

def initialize regexp
  @regexp = regexp
end

Instance Method Details

#match?(arg) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/synoption/match.rb', line 43

def match? arg
  arg && @regexp.match(arg)
end