Class: HypermediaAPI::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/api/link.rb

Instance Method Summary collapse

Constructor Details

#initialize(href_uri) ⇒ Link

Returns a new instance of Link.



4
5
6
# File 'lib/api/link.rb', line 4

def initialize (href_uri)
  @href_uri = href_uri
end

Instance Method Details

#click(options = {}) ⇒ Object



8
9
10
11
12
# File 'lib/api/link.rb', line 8

def click (options = {})
  document = HypermediaAPI.get(@href_uri, options)
rescue SocketError
  raise BadURI, "The client was unable to interact with a resource at #{@href_uri}."
end