| Module | URITemplate::RFC6570::ClassMethods |
| In: |
lib/uri_template/rfc6570.rb
|
The class methods for all rfc6570 templates.
Tries to convert the given param in to a instance of {RFC6570} It basically passes thru instances of that class, parses strings and return nil on everything else.
@example
URITemplate::RFC6570.try_convert( Object.new ) #=> nil
tpl = URITemplate::RFC6570.new('{foo}')
URITemplate::RFC6570.try_convert( tpl ) #=> tpl
URITemplate::RFC6570.try_convert('{foo}') #=> tpl
URITemplate::RFC6570.try_convert(URITemplate.new(:colon, ':foo')) #=> tpl
# This pattern is invalid, so it wont be parsed:
URITemplate::RFC6570.try_convert('{foo') #=> nil