Class: Syndication::Atom::Link
- Defined in:
- lib/syndication/atom.rb
Overview
A Link represents a hypertext link to another object from an Atom feed. Examples include the link with rel=self to the canonical URL of the feed.
Instance Attribute Summary collapse
-
#href ⇒ Object
The URI of the link.
-
#length ⇒ Object
The length of the linked-to object in bytes.
-
#rel ⇒ Object
The type of relationship the link expresses.
-
#title ⇒ Object
The title for the link.
-
#type ⇒ Object
The type of object at the other end of the link.
Instance Method Summary collapse
-
#initialize(parent, tag, attrs = nil) ⇒ Link
constructor
A new instance of Link.
Methods inherited from Container
#parse_date, #store, #store_category, #strip, #tag2method, #tag_end, #tag_start
Constructor Details
#initialize(parent, tag, attrs = nil) ⇒ Link
Returns a new instance of Link.
204 205 206 207 208 209 210 211 212 |
# File 'lib/syndication/atom.rb', line 204 def initialize(parent, tag, attrs = nil) @tag = tag @parent = parent if attrs attrs.each_pair {|key, value| self.store(key, value) } end end |
Instance Attribute Details
#href ⇒ Object
The URI of the link.
198 199 200 |
# File 'lib/syndication/atom.rb', line 198 def href @href end |
#length ⇒ Object
The length of the linked-to object in bytes.
202 203 204 |
# File 'lib/syndication/atom.rb', line 202 def length @length end |
#rel ⇒ Object
The type of relationship the link expresses.
199 200 201 |
# File 'lib/syndication/atom.rb', line 199 def rel @rel end |
#title ⇒ Object
The title for the link.
201 202 203 |
# File 'lib/syndication/atom.rb', line 201 def title @title end |
#type ⇒ Object
The type of object at the other end of the link.
200 201 202 |
# File 'lib/syndication/atom.rb', line 200 def type @type end |