Class: Superfeedr::Entry

Inherits:
Node
  • Object
show all
Defined in:
lib/superfeedr/superfeedr.rb

Instance Method Summary collapse

Methods inherited from Node

#initialize

Constructor Details

This class inherits a constructor from Superfeedr::Node

Instance Method Details

#authorsObject



80
81
82
# File 'lib/superfeedr/superfeedr.rb', line 80

def authors
  xpath(".//atom:author").map { |child| Author.new(child) }
end

#categoriesObject



76
77
78
# File 'lib/superfeedr/superfeedr.rb', line 76

def categories
  xpath(".//atom:category/@term").map { |c| c.text }
end

#contentObject

entry : The content of the entry. Check the type attribute to determine the mime-type.



53
54
55
# File 'lib/superfeedr/superfeedr.rb', line 53

def content
  content_from("atom:content")
end

#idObject

entry : the Unique ID of the entry. If the original entry doesn’t have an ID.



33
34
35
# File 'lib/superfeedr/superfeedr.rb', line 33

def id
  content_from("atom:id")
end

#langObject

entry : The language of the entry. It’s either extracted or computed from the content (the longer t# he content, the more relevant).



67
68
69
# File 'lib/superfeedr/superfeedr.rb', line 67

def lang
  content_from("@lang")
end


71
72
73
74
# File 'lib/superfeedr/superfeedr.rb', line 71

def link
  child = xpath("atom:link")
  Link.new(child) if child
end

#mime_typeObject



57
58
59
# File 'lib/superfeedr/superfeedr.rb', line 57

def mime_type
  content_from("atom:content/@type")
end

#pointsObject



84
85
86
# File 'lib/superfeedr/superfeedr.rb', line 84

def points
  xpath(".//geo:point").map { |child| Point.new(child) }
end

#published_atObject

entry : The publication date (iso8601) of the entry.



43
44
45
# File 'lib/superfeedr/superfeedr.rb', line 43

def published_at
  datetime_from("atom:published")
end

#summaryObject

entry (optional, unique) : The summary of the entry. Check the type attribute to determine the mime-type



62
63
64
# File 'lib/superfeedr/superfeedr.rb', line 62

def summary
  content_from("atom:summary")
end

#titleObject

entry : The title of the entry.



38
39
40
# File 'lib/superfeedr/superfeedr.rb', line 38

def title
  content_from("atom:title")
end

#updated_atObject

entry : The last updated date (iso8601) of the entry.



48
49
50
# File 'lib/superfeedr/superfeedr.rb', line 48

def updated_at
  datetime_from("atom:updated")
end