lib/trav3/response/response_collection.rb in trav3-0.3.4 vs lib/trav3/response/response_collection.rb in trav3-0.4.0
- old
+ new
@@ -46,9 +46,16 @@
def first
self[0]
end
+ # Follows `@href` link within item.
+ # If `#hash?` returns `true` then `#follow` takes no parameters.
+ # If `#hash?` returns `false` then `#follow` takes an index parameter
+ # for which item in the Array you wish to follow.
+ #
+ # @param idx [Integer] (optional parameter) index of array of item to follow `@href` url from
+ # @return [Success, RequestError]
def follow(idx = nil)
if href? && !idx
url = collection.fetch('@href')
return travis.send(:get_path_with_opts, url)
end