lib/hyperclient/curie.rb in hyperclient-0.7.0 vs lib/hyperclient/curie.rb in hyperclient-0.7.1
- old
+ new
@@ -5,12 +5,12 @@
# to express curie relation URIs in a friendlier, more compact fashion.
#
class Curie
# Public: Initializes a new Curie.
#
- # curie - The String with the URI of the curie.
- # entry_point - The EntryPoint object to inject the cofnigutation.
+ # curie_hash - The String with the URI of the curie.
+ # entry_point - The EntryPoint object to inject the configuration.
def initialize(curie_hash, entry_point)
@curie_hash = curie_hash
@entry_point = entry_point
end
@@ -20,26 +20,26 @@
# Returns false if it not templated.
def templated?
!!@curie_hash['templated']
end
- # Public: Returns the name property of the Curie
+ # Public: Returns the name property of the Curie.
def name
@curie_hash['name']
end
- # Public: Returns the href property of the Curie
+ # Public: Returns the href property of the Curie.
def href
@curie_hash['href']
end
def inspect
"#<#{self.class.name} #{@curie_hash}>"
end
# Public: Expands the Curie when is templated with the given variables.
#
- # rel - The rel to expand.
+ # rel - The String rel to expand.
#
# Returns a new expanded url.
def expand(rel)
return rel unless rel && templated?
href.gsub('{rel}', rel) if href