Class: Farseer::Regexp
- Inherits:
-
Object
- Object
- Farseer::Regexp
- Includes:
- MapFactory
- Defined in:
- lib/farseer/regexp.rb
Constant Summary collapse
- WS_REGEXP =
/^(?'token'\s*)(?'rest'.*)$/
- RegexpError =
Class.new(ArgumentError)
- WS =
new(WS_REGEXP)
Instance Method Summary collapse
-
#initialize(regexp) ⇒ Regexp
constructor
A new instance of Regexp.
- #parse(input) ⇒ Object
Methods included from MapFactory
Constructor Details
#initialize(regexp) ⇒ Regexp
Returns a new instance of Regexp.
10 11 12 13 14 15 |
# File 'lib/farseer/regexp.rb', line 10 def initialize(regexp) raise RegexpError unless regexp.names == ['token', 'rest'] @regexp = regexp freeze end |