Method: Jdoc::Link#path

Defined in:
lib/jdoc/link.rb

#pathString

Note:

URI Template is replaced with placeholder

Returns Request path name, defined at href property.

Examples:

link.path #=> "GET /apps/:id"

Returns:

  • (String)

    Request path name, defined at href property



59
60
61
62
63
# File 'lib/jdoc/link.rb', line 59

def path
  @path ||= @raw_link.href.gsub(/{(.+?)}/) do
    ":" + CGI.unescape($1).gsub(/[()\s]/, "").split("/").last
  end
end