class FeedParser::Item

Attributes

attachments[RW]

add attachments/media enclosures (url, length and type)

note: lets support more than one (it's an array)
authors[RW]
categories[RW]
content[RW]
content_html[RW]
content_html=[RW]
content_text[RW]
description[RW]
description=[RW]
enclosures[RW]

add attachments/media enclosures (url, length and type)

note: lets support more than one (it's an array)
external_url[RW]
guid[RW]
guid=[RW]
id[RW]
published[RW]
published_line[RW]
published_local[RW]
published_text[RW]
summary[RW]
tags[RW]
title[RW]
updated[RW]
updated_line[RW]
updated_local[RW]
updated_text[RW]
url[RW]

Public Class Methods

new() click to toggle source
# File lib/feedparser/item.rb, line 99
def initialize
  ## note: make authors, tags empty arrays on startup (e.g. not nil)
  @authors     = []
  @tags        = []
  @attachments = []
end

Public Instance Methods

attachment() click to toggle source
# File lib/feedparser/item.rb, line 89
def attachment()    @attachments[0]; end
Also aliased as: enclosure
attachment?()
Alias for: attachments?
attachments?() click to toggle source
# File lib/feedparser/item.rb, line 90
def attachments?()  @attachments && @attachments.size > 0;  end
Also aliased as: attachment?, enclosures?, enclosure?
author() click to toggle source

add author shortcut e.g. equals authors - for now only read only

fix: also add author=  why? why not???
# File lib/feedparser/item.rb, line 76
def author() @authors[0]; end
author?()

note: author? is an alias for authors?

Alias for: authors?
authors?() click to toggle source

add author shortcut e.g. equals authors - for now only read only

fix: also add author=  why? why not???
# File lib/feedparser/item.rb, line 70
def authors?()  @authors && @authors.size > 0;  end
Also aliased as: author?
content?() click to toggle source

note: only content/content_html should use html;

all others (e.g. title/summary/content_text) shoud be plain (vanilla) text
# File lib/feedparser/item.rb, line 20
def content?()  @content.nil? == false;  end
Also aliased as: content_html?
content_html?()
Alias for: content?
content_text?() click to toggle source
# File lib/feedparser/item.rb, line 30
def content_text?()  @content_text.nil? == false;  end
description?()
Alias for: summary?
enclosure()
Alias for: attachment
enclosure?()
Alias for: attachments?
enclosures?()
Alias for: attachments?
published?() click to toggle source
# File lib/feedparser/item.rb, line 53
def published?()  @published.nil? == false;  end
summary?() click to toggle source
# File lib/feedparser/item.rb, line 35
def summary?()  @summary.nil? == false;  end
Also aliased as: description?
tags?() click to toggle source
# File lib/feedparser/item.rb, line 80
def tags?()  @tags && @tags.size > 0;  end
updated?() click to toggle source
# File lib/feedparser/item.rb, line 45
def updated?()  @updated.nil? == false;  end