Redoc
Constants
METHOD_PATTERN = /(?:(?:_\w|[a-z])\w*(?:!|\?|=)?|[-+^`~%|]|\*\*?|\/\/?|!(?:=|~)?|=(?:=|==|~)?|<(?:<|=)?|>(?:>|=)?|<=>|&(?:\+|-|\*)?|\[](?:\?|=)?)/
QUERY_PATTERN = /^(?:(?<dname>(?:::)?#{METHOD_PATTERN})|(?<tpath>(?:(?:::)?[A-Z]\w*)+)(?:(?<tscope>\.|#)(?<tname>#{METHOD_PATTERN}))?)$/
VERSION = "0.1.0"
Class methods
Loads a library from source. This should be the generated JSON of a Crystal library
which can be obtained from the crystal docs --json command.
Same as parse_query? but raises an Error if pattern is invalid.
Parses a query from pattern. Returns an array of strings representing the namespace,
a nilable string representing the symbol, and the query scope (see Library#resolve?).
The pattern is expected to be in Crystal path format which is defined as follows:
- "::" is used for namespace accessors
- "." is used for class method accessors
- "#" is used for instance method accessors
The following is in valid format:
puts::putsString.build::Char::Reader#pos
This also supports operator methods and methods that end in =, ! or ?:
!Regex#=~Array#[]?
The following is in invalid format:
to_s.nil?IO.MemoryJSON#Any