class RSS::Item

Overview

A channel may contain any number of Items. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed), and the link and title may be omitted. All elements of an item are optional, however at least one of title or description must be present.

Defined in:

cryss/item.cr

Constructors

Instance Method Summary

Instance methods inherited from class RSS::Element

ns(name : String, &) ns, to_s(io : IO) to_s, to_xml(io : IO)
to_xml(xml : XML::Builder)
to_xml

Constructor Detail

def self.new(title : Nil | String = nil, description : Nil | String = nil) #

[View source]

Instance Method Detail

def author : String | Nil #

Email address of the author of the item.


[View source]
def author=(author : Nil | String) #

[View source]
def category : Category | Nil #

Includes the item in one or more categories.

The value of the element is a forward-slash-separated string that identifies a hierarchic location in the indicated taxonomy. Processors may establish conventions for the interpretation of categories. Two examples are provided below: getter category : String?


[View source]
def category=(category : Nil | RSS::Category) #

[View source]
def comments : URI | Nil #

Optional URL of the comments page for the item.

<comments>http://rateyourmusic.com/yaccs/commentsn/blogId=705245&itemId=271</comments>

[View source]
def comments=(comments : Nil | URI) #

[View source]
def description : String | Nil #

The item synopsis.


[View source]
def description=(description : Nil | String) #

[View source]
def enclosure : Enclosure | Nil #

Describes a media object that is attached to the item.


[View source]
def enclosure=(enclosure : Nil | RSS::Enclosure) #

[View source]
def guid : URI | Nil #

Optional globally unique identifier.

It's a string that uniquely identifies the item. When present, an aggregator may choose to use this string to determine if an item is new.

<guid>http://some.server.com/weblogItem3207<guid>

There are no rules for the syntax of a guid. Aggregators must view them as a string. It's up to the source of the feed to establish the uniqueness of the string.

If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the element. An example:

<guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid>

is_perma_link is optional and defaults to true. If its value is false, the guid may not be assumed to be a url, or a url to anything in particular.


[View source]
def guid=(guid : Nil | URI) #

[View source]
def guid_is_perma_link : Bool #

See #guid.


[View source]
def guid_is_perma_link=(guid_is_perma_link : Bool) #

[View source]
def link : URI | Nil #

The URL of the item.


[View source]
def link=(link : Nil | URI) #

[View source]
def pub_date : Time | Nil #

is an optional sub-element of .

Its value is a date, indicating when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date.


[View source]
def pub_date=(pub_date : Time | Nil) #

[View source]
def source : String | Nil #

The RSS channel that the item came from.


[View source]
def source=(source : Nil | String) #

[View source]
def source_url : URI | Nil #

Required if source is non-nil.


[View source]
def source_url=(source_url : Nil | URI) #

[View source]
def title : String | Nil #

The title of the item.


[View source]
def title=(title : Nil | String) #

[View source]
def to_xml(xml : XML::Builder) #

Serialises the item to the XML builder.


[View source]