class AtomFeed::AtomLink

Public Class Methods

new(node) click to toggle source

Initializes the link.

# File lib/atom_feed/atom_link.rb, line 4
def initialize(node)
  @node = node
end

Public Instance Methods

alternate?() click to toggle source

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
edit?() click to toggle source

Link to edit?

# File lib/atom_feed/atom_link.rb, line 48
def edit?
  self.rel == "edit"
end
enclosure?() click to toggle source

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
first?() click to toggle source

Reference to first search result in OpenSearch (OpenSearch extension)?

# File lib/atom_feed/atom_link.rb, line 58
def first?
  self.rel == "first"
end
href() click to toggle source

The URI of the referenced resource (required).

# File lib/atom_feed/atom_link.rb, line 9
def href
  @node["href"]
end
hreflang() click to toggle source

Language of the referenced resource (optional)

# File lib/atom_feed/atom_link.rb, line 83
def hreflang
  @node["hreflang"]
end
last?() click to toggle source

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() click to toggle source

Length of the resource in bytes (optional).

# File lib/atom_feed/atom_link.rb, line 93
def length
  @node["length"]
end
next?() click to toggle source

Reference to next search results in OpenSearch (OpenSearch extension)?

# File lib/atom_feed/atom_link.rb, line 68
def next?
  self.rel == "next"
end
previous?() click to toggle source

Reference to previous search results in OpenSearch (OpenSearch extension)?

# File lib/atom_feed/atom_link.rb, line 63
def previous?
  self.rel == "previous"
end
rel() click to toggle source

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
search?() click to toggle source

Reference to OpenSearch description document (OpenSearch extension)?

# File lib/atom_feed/atom_link.rb, line 53
def search?
  self.rel == "search"
end
self?() click to toggle source

The feed itself?

# File lib/atom_feed/atom_link.rb, line 38
def self?
  self.rel == "self"
end
title() click to toggle source

Human readable information about the link (optional)

# File lib/atom_feed/atom_link.rb, line 88
def title
  @node["title"]
end
type() click to toggle source

Media type of the resource (optional)

# File lib/atom_feed/atom_link.rb, line 78
def type
  @node["type"]
end
via?() click to toggle source

Source of the information provided in the entry?

# File lib/atom_feed/atom_link.rb, line 43
def via?
  self.rel == "via"
end