Class: Lab42::Rgxargs::Syntax
- Inherits:
-
Object
- Object
- Lab42::Rgxargs::Syntax
- Defined in:
- lib/lab42/rgxargs/syntax.rb
Instance Attribute Summary collapse
-
#converter ⇒ Object
readonly
Returns the value of attribute converter.
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
Instance Method Summary collapse
Instance Attribute Details
#converter ⇒ Object (readonly)
Returns the value of attribute converter.
3 4 5 |
# File 'lib/lab42/rgxargs/syntax.rb', line 3 def converter @converter end |
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
3 4 5 |
# File 'lib/lab42/rgxargs/syntax.rb', line 3 def matcher @matcher end |
Instance Method Details
#matches?(value) ⇒ Boolean
5 6 7 8 9 10 |
# File 'lib/lab42/rgxargs/syntax.rb', line 5 def matches? value if match = matcher.match(value) yield converter.(*match.captures) true end end |