Class: AtomFeed::AtomLink
Instance Method Summary collapse
-
#alternate? ⇒ Boolean
An alternate represenation of the entry or feed, e.g.
-
#edit? ⇒ Boolean
Link to edit?.
-
#enclosure? ⇒ Boolean
A related resource (potentially large in size and might need special handling), e.g.
-
#first? ⇒ Boolean
Reference to first search result in OpenSearch (OpenSearch extension)?.
-
#href ⇒ Object
The URI of the referenced resource (required).
-
#hreflang ⇒ Object
Language of the referenced resource (optional).
-
#initialize(node) ⇒ AtomLink
constructor
Initializes the link.
-
#last? ⇒ Boolean
Reference to last search result in OpenSearch (OpenSearch extension)?.
-
#length ⇒ Object
Length of the resource in bytes (optional).
-
#next? ⇒ Boolean
Reference to next search results in OpenSearch (OpenSearch extension)?.
-
#previous? ⇒ Boolean
Reference to previous search results in OpenSearch (OpenSearch extension)?.
-
#rel ⇒ Object
A single link relationship type (optional).
-
#related? ⇒ Boolean
A document related to the feed or entry?.
-
#search? ⇒ Boolean
Reference to OpenSearch description document (OpenSearch extension)?.
-
#self? ⇒ Boolean
The feed itself?.
-
#title ⇒ Object
Human readable information about the link (optional).
-
#type ⇒ Object
Media type of the resource (optional).
-
#via? ⇒ Boolean
Source of the information provided in the entry?.
Constructor Details
#initialize(node) ⇒ AtomLink
Initializes the link.
4 5 6 |
# File 'lib/atom_feed/atom_link.rb', line 4 def initialize(node) @node = node end |
Instance Method Details
#alternate? ⇒ Boolean
An alternate represenation of the entry or feed, e.g. a permalink to the HTML version of the resource?
22 23 24 |
# File 'lib/atom_feed/atom_link.rb', line 22 def alternate? self.rel == "alternate" end |
#edit? ⇒ Boolean
Link to edit?
48 49 50 |
# File 'lib/atom_feed/atom_link.rb', line 48 def edit? self.rel == "edit" end |
#enclosure? ⇒ Boolean
A related resource (potentially large in size and might need special handling), e.g. an image or video recording?
28 29 30 |
# File 'lib/atom_feed/atom_link.rb', line 28 def enclosure? self.rel == "enclosure" end |
#first? ⇒ Boolean
Reference to first search result in OpenSearch (OpenSearch extension)?
58 59 60 |
# File 'lib/atom_feed/atom_link.rb', line 58 def first? self.rel == "first" end |
#href ⇒ Object
The URI of the referenced resource (required).
9 10 11 |
# File 'lib/atom_feed/atom_link.rb', line 9 def href @node["href"] end |
#hreflang ⇒ Object
Language of the referenced resource (optional)
83 84 85 |
# File 'lib/atom_feed/atom_link.rb', line 83 def hreflang @node["hreflang"] end |
#last? ⇒ Boolean
Reference to last search result in OpenSearch (OpenSearch extension)?
73 74 75 |
# File 'lib/atom_feed/atom_link.rb', line 73 def last? self.rel == "last" end |
#length ⇒ Object
Length of the resource in bytes (optional).
93 94 95 |
# File 'lib/atom_feed/atom_link.rb', line 93 def length @node["length"] end |
#next? ⇒ Boolean
Reference to next search results in OpenSearch (OpenSearch extension)?
68 69 70 |
# File 'lib/atom_feed/atom_link.rb', line 68 def next? self.rel == "next" end |
#previous? ⇒ Boolean
Reference to previous search results in OpenSearch (OpenSearch extension)?
63 64 65 |
# File 'lib/atom_feed/atom_link.rb', line 63 def previous? self.rel == "previous" end |
#rel ⇒ Object
A single link relationship type (optional). It could be a full URI or one of some predefined values. Returns “alternate” as default.
16 17 18 |
# File 'lib/atom_feed/atom_link.rb', line 16 def rel @node["rel"] || "alternate" end |
#related? ⇒ Boolean
A document related to the feed or entry?
33 34 35 |
# File 'lib/atom_feed/atom_link.rb', line 33 def self.rel == "related" end |
#search? ⇒ Boolean
Reference to OpenSearch description document (OpenSearch extension)?
53 54 55 |
# File 'lib/atom_feed/atom_link.rb', line 53 def search? self.rel == "search" end |
#self? ⇒ Boolean
The feed itself?
38 39 40 |
# File 'lib/atom_feed/atom_link.rb', line 38 def self? self.rel == "self" end |
#title ⇒ Object
Human readable information about the link (optional)
88 89 90 |
# File 'lib/atom_feed/atom_link.rb', line 88 def title @node["title"] end |
#type ⇒ Object
Media type of the resource (optional)
78 79 80 |
# File 'lib/atom_feed/atom_link.rb', line 78 def type @node["type"] end |
#via? ⇒ Boolean
Source of the information provided in the entry?
43 44 45 |
# File 'lib/atom_feed/atom_link.rb', line 43 def via? self.rel == "via" end |