Method: Hyperclient::Curie#expand

Defined in:
lib/hyperclient/curie.rb

#expand(rel) ⇒ Object

Expands the Curie when is templated with the given variables.

Parameters:

  • rel

    The String rel to expand.

Returns:

  • a new expanded url.



42
43
44
45
46
# File 'lib/hyperclient/curie.rb', line 42

def expand(rel)
  return rel unless rel && templated?

  href&.gsub('{rel}', rel)
end