Class
Defines the top-level element of an Atom
Feed
Document. It consists of a number of children Entry
elements, and has the following attributes:
-
author
-
categories
-
category
-
content
-
contributor
-
entries (aliased as items)
-
entry
-
generator
-
icon
-
id
-
link
-
logo
-
rights
-
subtitle
-
title
-
updated
Reference: validator.w3.org/feed/docs/rfc4287.html#element.feed
Class Methods
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 313
def initialize(version=nil, encoding=nil, standalone=nil)
super("1.0", version, encoding, standalone)
@feed_type = "atom"
@feed_subtype = "feed"
end
Creates a new Atom
feed
Instance Methods
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 329
def atom_validate(ignore_unknown_element, tags, uri)
unless have_author?
raise MissingTagError.new("author", tag_name)
end
validate_duplicate_links(links)
end
No documentation available
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 323
def have_author?
authors.any? {|author| !author.to_s.empty?} or
entries.any? {|entry| entry.have_author?(false)}
end
Returns true if there are any authors for the feed or any of the Entry
child elements have an author
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 336
def have_required_elements?
super and have_author?
end
No documentation available
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 340
def maker_target(maker)
maker.channel
end
No documentation available
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 344
def setup_maker_element(channel)
prev_dc_dates = channel.dc_dates.to_a.dup
super
channel.about = id.content if id
channel.dc_dates.replace(prev_dc_dates)
end
No documentation available
lib/rss/atom.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rss/atom.rb, line 351
def setup_maker_elements(channel)
super
items = channel.maker.items
entries.each do |entry|
entry.setup_maker(items)
end
end
No documentation available