Class: RSSable::Parsers::Items::Wordpress
- Defined in:
- lib/rssable/parsers/items/wordpress.rb
Instance Method Summary collapse
-
#author ⇒ String
Returns the article author.
-
#comments_count ⇒ Integer
Returns the comments count If the comments count node does not exist it returns nil.
Methods inherited from Base
#description, #initialize, #link, #published_at, #tags, #title
Constructor Details
This class inherits a constructor from RSSable::Parsers::Items::Base
Instance Method Details
#author ⇒ String
Returns the article author
9 10 11 12 |
# File 'lib/rssable/parsers/items/wordpress.rb', line 9 def creator_node = node.elements.find { |c| c.name == "creator" } node_text(creator_node) end |
#comments_count ⇒ Integer
Returns the comments count If the comments count node does not exist it returns nil
18 19 20 21 |
# File 'lib/rssable/parsers/items/wordpress.rb', line 18 def comments_count count = node_text(node.at_xpath("//slash:comments")) count.to_i unless count.nil? end |