Class: WebFinger::Response

Inherits:
ActiveSupport::HashWithIndifferentAccess
  • Object
show all
Defined in:
lib/webfinger/response.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jrd) ⇒ Response

Returns a new instance of Response.



6
7
8
# File 'lib/webfinger/response.rb', line 6

def initialize(jrd)
  replace jrd
end

Class Method Details

.new_from_hash_copying_default(hash) ⇒ Object

NOTE: Ugly hack to avoid this ActiveSupport 4.0 bug.

https://github.com/rails/rails/issues/11087


25
26
27
# File 'lib/webfinger/response.rb', line 25

def new_from_hash_copying_default(hash)
  superclass.new_from_hash_copying_default hash
end

Instance Method Details



16
17
18
19
20
# File 'lib/webfinger/response.rb', line 16

def link_for(rel)
  links.detect do |link|
    link[:rel] == rel
  end
end