Class: SwaggerYard::TypeParser::Parser

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/swagger_yard/type_parser.rb

Instance Method Summary collapse

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