Class: Prompt::SimpleMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/prompt/simple_matcher.rb

Constant Summary

Constants inherited from Matcher

Matcher::SEP

Instance Attribute Summary

Attributes inherited from Matcher

#parameter

Instance Method Summary collapse

Methods inherited from Matcher

#initialize

Constructor Details

This class inherits a constructor from Prompt::Matcher

Instance Method Details

#matches(s) ⇒ Object



8
9
10
# File 'lib/prompt/simple_matcher.rb', line 8

def matches s
  s
end

#regexObject



4
5
6
# File 'lib/prompt/simple_matcher.rb', line 4

def regex
  "(?<#{parameter.name}>[^#{Prompt::Command::SEP}]*)"
end