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



93
94
95
96
97
# File 'lib/jdoc/link.rb', line 93

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