class AtomFeed::AtomLink
Public Class Methods
Initializes the link.
# File lib/atom_feed/atom_link.rb, line 4 def initialize(node) @node = node end
Public Instance Methods
An alternate represenation of the entry or feed, e.g. a permalink to the HTML version of the resource?
# File lib/atom_feed/atom_link.rb, line 22 def alternate? self.rel == "alternate" end
Link to edit?
# File lib/atom_feed/atom_link.rb, line 48 def edit? self.rel == "edit" end
A related resource (potentially large in size and might need special handling), e.g. an image or video recording?
# File lib/atom_feed/atom_link.rb, line 28 def enclosure? self.rel == "enclosure" end
Reference to first search result in OpenSearch
(OpenSearch
extension)?
# File lib/atom_feed/atom_link.rb, line 58 def first? self.rel == "first" end
The URI of the referenced resource (required).
# File lib/atom_feed/atom_link.rb, line 9 def href @node["href"] end
Language of the referenced resource (optional)
# File lib/atom_feed/atom_link.rb, line 83 def hreflang @node["hreflang"] end
Reference to last search result in OpenSearch
(OpenSearch
extension)?
# File lib/atom_feed/atom_link.rb, line 73 def last? self.rel == "last" end
Length of the resource in bytes (optional).
# File lib/atom_feed/atom_link.rb, line 93 def length @node["length"] end
Reference to next search results in OpenSearch
(OpenSearch
extension)?
# File lib/atom_feed/atom_link.rb, line 68 def next? self.rel == "next" end
Reference to previous search results in OpenSearch
(OpenSearch
extension)?
# File lib/atom_feed/atom_link.rb, line 63 def previous? self.rel == "previous" end
A single link relationship type (optional). It could be a full URI or one of some predefined values. Returns “alternate” as default.
# File lib/atom_feed/atom_link.rb, line 16 def rel @node["rel"] || "alternate" end
Reference to OpenSearch
description document (OpenSearch
extension)?
# File lib/atom_feed/atom_link.rb, line 53 def search? self.rel == "search" end
The feed itself?
# File lib/atom_feed/atom_link.rb, line 38 def self? self.rel == "self" end
Human readable information about the link (optional)
# File lib/atom_feed/atom_link.rb, line 88 def title @node["title"] end
Media type of the resource (optional)
# File lib/atom_feed/atom_link.rb, line 78 def type @node["type"] end
Source of the information provided in the entry?
# File lib/atom_feed/atom_link.rb, line 43 def via? self.rel == "via" end