Class: WebFinger::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/webfinger/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource, options = {}) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
# File 'lib/webfinger/request.rb', line 5

def initialize(resource, options = {})
  self.resource = resource
  self.relations = Array(options[:rel] || options[:relations])
  @options = options
end

Instance Attribute Details

#relationsObject

Returns the value of attribute relations.



3
4
5
# File 'lib/webfinger/request.rb', line 3

def relations
  @relations
end

#resourceObject

Returns the value of attribute resource.



3
4
5
# File 'lib/webfinger/request.rb', line 3

def resource
  @resource
end

Instance Method Details

#discover!Object



11
12
13
14
15
# File 'lib/webfinger/request.rb', line 11

def discover!
  handle_response do
    WebFinger.http_client.get(endpoint.to_s)
  end
end