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



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

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

#categoriesObject



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

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.



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

def content
  content_from("atom:content")
end

#idObject

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



36
37
38
# File 'lib/superfeedr/superfeedr.rb', line 36

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).



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

def lang
  content_from("@lang")
end


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

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

#mime_typeObject



60
61
62
# File 'lib/superfeedr/superfeedr.rb', line 60

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

#pointsObject



87
88
89
# File 'lib/superfeedr/superfeedr.rb', line 87

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

#published_atObject

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



46
47
48
# File 'lib/superfeedr/superfeedr.rb', line 46

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



65
66
67
# File 'lib/superfeedr/superfeedr.rb', line 65

def summary
  content_from("atom:summary")
end

#titleObject

entry : The title of the entry.



41
42
43
# File 'lib/superfeedr/superfeedr.rb', line 41

def title
  content_from("atom:title")
end

#updated_atObject

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



51
52
53
# File 'lib/superfeedr/superfeedr.rb', line 51

def updated_at
  datetime_from("atom:updated")
end