Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lsegal/yard-types-parser

Parses YARD formal type declarations into a human readable format.
https://github.com/lsegal/yard-types-parser

Last synced: about 2 months ago
JSON representation

Parses YARD formal type declarations into a human readable format.

Awesome Lists containing this project

README

        

YARD Types Parser
=================

Parses YARD type declarations and translates them into plain English. A quick
example of a YARD type declaration is in the following parameter declaration:

# @param [Array] arg takes an Array of Strings or Symbols
def foo(arg)
end

The parser will convert `Array` into the more readable:

an Array of (Strings or Symbols)

You can quickly parse with:

Parser.new("String, Symbol, false").parse.list_join
#=> "a String, a Symbol or false"

You can try this yourself live at [http://yard.soen.ca/types](http://yard.soen.ca/types)
with plenty more examples.