Class: SimpleRSS
- Inherits:
-
Object
- Object
- SimpleRSS
- Defined in:
- lib/simple-rss.rb
Constant Summary collapse
- VERSION =
"1.2.3"
[ :id, :title, :subtitle, :link, :description, :author, :webMaster, :managingEditor, :contributor, :pubDate, :lastBuildDate, :updated, :'dc:date', :generator, :language, :docs, :cloud, :ttl, :skipHours, :skipDays, :image, :logo, :icon, :rating, :rights, :copyright, :textInput, :'feedburner:browserFriendly', :'itunes:author', :'itunes:category' ]
[ :id, :title, :link, :'link+alternate', :'link+self', :'link+edit', :'link+replies', :author, :contributor, :description, :summary, :content, :'content:encoded', :comments, :pubDate, :published, :updated, :expirationDate, :modified, :'dc:date', :category, :guid, :'trackback:ping', :'trackback:about', :'dc:creator', :'dc:title', :'dc:subject', :'dc:rights', :'dc:publisher', :'feedburner:origLink', :'media:content#url', :'media:content#type', :'media:content#height', :'media:content#width', :'media:title', :'media:thumbnail#url', :'media:thumbnail#height', :'media:thumbnail#width', :'media:credit', :'media:credit#role', :'media:category', :'media:category#scheme' ]
Instance Attribute Summary collapse
-
#items ⇒ Object
(also: #entries)
readonly
Returns the value of attribute items.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Class Method Summary collapse
- .feed_tags ⇒ Object
- .feed_tags=(ft) ⇒ Object
- .item_tags ⇒ Object
- .item_tags=(it) ⇒ Object
-
.parse(source, options = {}) ⇒ Object
The strict attribute is for compatibility with Ruby’s standard RSS parser.
Instance Method Summary collapse
- #channel ⇒ Object (also: #feed)
-
#initialize(source, options = {}) ⇒ SimpleRSS
constructor
A new instance of SimpleRSS.
Constructor Details
#initialize(source, options = {}) ⇒ SimpleRSS
Returns a new instance of SimpleRSS.
40 41 42 43 44 45 46 |
# File 'lib/simple-rss.rb', line 40 def initialize(source, ={}) @source = source.respond_to?(:read) ? source.read : source.to_s @items = Array.new @options = Hash.new.update() parse end |
Instance Attribute Details
#items ⇒ Object (readonly) Also known as: entries
Returns the value of attribute items.
7 8 9 |
# File 'lib/simple-rss.rb', line 7 def items @items end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/simple-rss.rb', line 7 def source @source end |
Class Method Details
.feed_tags ⇒ Object
52 53 54 |
# File 'lib/simple-rss.rb', line 52 def @@feed_tags end |
.feed_tags=(ft) ⇒ Object
55 56 57 |
# File 'lib/simple-rss.rb', line 55 def (ft) @@feed_tags = ft end |
.item_tags ⇒ Object
59 60 61 |
# File 'lib/simple-rss.rb', line 59 def @@item_tags end |
.item_tags=(it) ⇒ Object
62 63 64 |
# File 'lib/simple-rss.rb', line 62 def (it) @@item_tags = it end |
.parse(source, options = {}) ⇒ Object
The strict attribute is for compatibility with Ruby’s standard RSS parser
67 68 69 |
# File 'lib/simple-rss.rb', line 67 def parse(source, ={}) new source, end |
Instance Method Details
#channel ⇒ Object Also known as: feed
48 |
# File 'lib/simple-rss.rb', line 48 def channel() self end |