Module: RSS::Atom::FeedHistory

Included in:
Feed
Defined in:
lib/rss/atom/feed_history.rb,
lib/rss/atom/feed_history/version.rb

Constant Summary collapse

PREFIX =
'fh'
URI =
'http://purl.org/syndication/history/1.0'
ELEMENTS =
[
  'complete',
  'archive'
]
PAGED_FEED_RELS =
['first', 'last', 'previous', 'next']
ARCHIVED_FEED_RELS =
['prev-archive', 'next-archive', 'current']
VERSION =
"0.0.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



17
18
19
20
21
22
# File 'lib/rss/atom/feed_history.rb', line 17

def included(klass)
  ELEMENTS.each do |name|
    full_name = "#{PREFIX}_#{name}"
    klass.install_have_child_element(name, URI, '?', full_name)
  end
end

Instance Method Details

#archived?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/rss/atom/feed_history.rb', line 33

def archived?
  !!fh_archive
end

#complete?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rss/atom/feed_history.rb', line 25

def complete?
  !!fh_complete
end

#paged?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/rss/atom/feed_history.rb', line 29

def paged?
  links.any? {|link| FeedHistory::PAGED_FEED_RELS.include? link.rel}
end