Class: Collecta::Result

Inherits:
Blather::Stanza::PubSub::Event
  • Object
show all
Defined in:
lib/collecta/result.rb

Instance Method Summary collapse

Instance Method Details

#abstractObject



15
16
17
# File 'lib/collecta/result.rb', line 15

def abstract
  self.entry.find('//ns:abstract', :ns => 'http://api.collecta.com/ns/search-0#results').first.inner_html.strip
end

#categoryObject



11
12
13
# File 'lib/collecta/result.rb', line 11

def category
  self.entry.content_from '//ns:category', :ns => 'http://api.collecta.com/ns/search-0#results'
end

#entryObject



19
20
21
# File 'lib/collecta/result.rb', line 19

def entry
  Blather::XMPPNode.new('event').inherit self.items.first.find_first('//ns:entry', :ns => 'http://www.w3.org/2005/Atom')
end

#queryObject



3
4
5
# File 'lib/collecta/result.rb', line 3

def query
  content_from('//ns:headers/ns:header[@name="x-collecta#query"]', :ns => 'http://jabber.org/protocol/shim').strip
end

#titleObject



7
8
9
# File 'lib/collecta/result.rb', line 7

def title
  self.entry.content_from '//ns:title', :ns => 'http://www.w3.org/2005/Atom'
end