Class: PVN::OptionRegexpMatch
- Inherits:
-
OptionMatch
- Object
- OptionMatch
- PVN::OptionRegexpMatch
- Defined in:
- lib/synoption/match.rb
Instance Method Summary collapse
-
#initialize(regexp) ⇒ OptionRegexpMatch
constructor
A new instance of OptionRegexpMatch.
- #match?(arg) ⇒ Boolean
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
43 44 45 |
# File 'lib/synoption/match.rb', line 43 def match? arg arg && @regexp.match(arg) end |