Method: Jdoc::Link#query_string

Defined in:
lib/jdoc/link.rb

#query_stringString?

Adds query string if a link has a schema property and method is GET

Examples:

link.query_string #=> "?type=Recipe"

Returns:

  • (String, nil)

    A query string prefixed with ‘?` only to GET request



77
78
79
80
81
# File 'lib/jdoc/link.rb', line 77

def query_string
  if method == "GET" && !request_parameters.empty?
    "?#{request_parameters.to_query}"
  end
end