Class: SwaggerYard::TypeParser::Parser
- Inherits:
-
Parslet::Parser
- Object
- Parslet::Parser
- SwaggerYard::TypeParser::Parser
- Defined in:
- lib/swagger_yard/type_parser.rb
Instance Method Summary collapse
-
#spaced(arg) ⇒ Object
Allow for whitespace surrounding a string value.
- #stri(str) ⇒ Object
Instance Method Details
#spaced(arg) ⇒ Object
Allow for whitespace surrounding a string value
7 8 9 |
# File 'lib/swagger_yard/type_parser.rb', line 7 def spaced(arg) space >> str(arg) >> space end |
#stri(str) ⇒ Object
11 12 13 14 15 |
# File 'lib/swagger_yard/type_parser.rb', line 11 def stri(str) key_chars = str.split(//) key_chars.collect! { |char| match["#{char.upcase}#{char.downcase}"] }. reduce(:>>) end |