Class: SimpleRSS
- Inherits:
-
Object
- Object
- SimpleRSS
- Defined in:
- lib/simple-rss.rb
Constant Summary collapse
- VERSION =
"2.0.0".freeze
- DATE_TAGS =
%i[pubDate lastBuildDate published updated expirationDate modified dc:date].freeze
- STRIP_HTML_TAGS =
%i[author contributor skipHours skipDays].freeze
%i[ 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 ]
%i[ 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:content#duration 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
: String.
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.
48 49 50 51 52 53 54 55 |
# File 'lib/simple-rss.rb', line 48 def initialize(source, = {}) @source = source.respond_to?(:read) ? source.read.to_s : source.to_s @items = [] #: Array[Hash[Symbol, untyped]] @options = {} #: Hash[Symbol, untyped] @options.update() parse end |
Instance Attribute Details
#items ⇒ Object (readonly) Also known as: entries
Returns the value of attribute items.
13 14 15 |
# File 'lib/simple-rss.rb', line 13 def items @items end |
#source ⇒ Object (readonly)
: String
14 15 16 |
# File 'lib/simple-rss.rb', line 14 def source @source end |
Class Method Details
.feed_tags ⇒ Object
65 66 67 |
# File 'lib/simple-rss.rb', line 65 def @@feed_tags end |
.feed_tags=(ft) ⇒ Object
70 71 72 |
# File 'lib/simple-rss.rb', line 70 def (ft) @@feed_tags = ft end |
.item_tags ⇒ Object
75 76 77 |
# File 'lib/simple-rss.rb', line 75 def @@item_tags end |
.item_tags=(it) ⇒ Object
80 81 82 |
# File 'lib/simple-rss.rb', line 80 def (it) @@item_tags = it end |
.parse(source, options = {}) ⇒ Object
The strict attribute is for compatibility with Ruby’s standard RSS parser
87 88 89 |
# File 'lib/simple-rss.rb', line 87 def parse(source, = {}) new source, end |
Instance Method Details
#channel ⇒ Object Also known as: feed
58 59 60 |
# File 'lib/simple-rss.rb', line 58 def channel self end |