Class: Redfinger::Finger

Inherits:
Object
  • Object
show all
Includes:
LinkHelpers
Defined in:
lib/redfinger/finger.rb

Overview

The result of a Webfinger. For more information about special helpers that are availale to pull specific types of URLs, see Redfinger::LinkHelpers

Instance Method Summary collapse

Methods included from LinkHelpers

#hcard, #open_id, #profile_page, #xfn

Constructor Details

#initialize(xml) ⇒ Finger

:nodoc:



8
9
10
11
# File 'lib/redfinger/finger.rb', line 8

def initialize(xml) # :nodoc:
  @doc = Nokogiri::XML::Document.parse(xml)
  @subject = @doc.at_css('Subject').content
end

Instance Method Details

#inspectObject

:nodoc:



18
19
20
# File 'lib/redfinger/finger.rb', line 18

def inspect # :nodoc:
  "<#Redfinger::Finger subject=\"#{@subject}\">"
end

All of the links provided by the Webfinger response.



14
15
16
# File 'lib/redfinger/finger.rb', line 14

def links
  @links ||= @doc.css('Link').map{|l| Link.new(l)}
end