Class: RSSable::Parsers::Items::Wordpress

Inherits:
Base
  • Object
show all
Defined in:
lib/rssable/parsers/items/wordpress.rb

Instance Method Summary collapse

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

#authorString

Returns the article author

Returns:

  • (String)


9
10
11
12
# File 'lib/rssable/parsers/items/wordpress.rb', line 9

def author
  creator_node = node.elements.find { |c| c.name == "creator" }
  node_text(creator_node)
end

#comments_countInteger

Returns the comments count If the comments count node does not exist it returns nil

Returns:

  • (Integer)


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