Class: RSSable::Parsers::Items::Base
- Inherits:
-
Object
- Object
- RSSable::Parsers::Items::Base
- Defined in:
- lib/rssable/parsers/items/base.rb
Instance Method Summary collapse
-
#author ⇒ String
Returns the article author.
-
#comments_count ⇒ NilClass
Returns nil by the default.
-
#description ⇒ String
Returns the item description.
-
#initialize(node) ⇒ Base
constructor
A new instance of Base.
-
#link ⇒ String
Returns the item link.
-
#published_at ⇒ String
Returns the item publication date.
-
#tags ⇒ Array<String>
Returns an array of the item categories.
-
#title ⇒ String
Returns the item title.
Constructor Details
#initialize(node) ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/rssable/parsers/items/base.rb', line 5 def initialize(node) @node = node end |
Instance Method Details
#author ⇒ String
Returns the article author
47 48 49 |
# File 'lib/rssable/parsers/items/base.rb', line 47 def node_text(node.at("author")) end |
#comments_count ⇒ NilClass
Returns nil by the default
54 |
# File 'lib/rssable/parsers/items/base.rb', line 54 def comments_count; end |
#description ⇒ String
Returns the item description
33 34 35 |
# File 'lib/rssable/parsers/items/base.rb', line 33 def description node_text(node.at("description")) end |
#link ⇒ String
Returns the item link
19 20 21 |
# File 'lib/rssable/parsers/items/base.rb', line 19 def link node_text(node.at("link")) end |
#published_at ⇒ String
Returns the item publication date
26 27 28 |
# File 'lib/rssable/parsers/items/base.rb', line 26 def published_at node_text(node.at("pubDate")) end |
#tags ⇒ Array<String>
Returns an array of the item categories
40 41 42 |
# File 'lib/rssable/parsers/items/base.rb', line 40 def node.css("category").map(&:text) end |
#title ⇒ String
Returns the item title
12 13 14 |
# File 'lib/rssable/parsers/items/base.rb', line 12 def title node_text(node.at("title")) end |