class WordpRSS::Item

Attributes

node[RW]

Public Class Methods

new(node) click to toggle source
# File lib/wordprss/item.rb, line 3
def initialize(node)
  @node = node
end

Public Instance Methods

creator() click to toggle source

Returns item author

@return [String]

# File lib/wordprss/item.rb, line 45
def creator
  creator_node = node.elements.last.children.find { |c| c.name == "dc:creator" }
  creator_node.text if !creator_node.nil?
end
description() click to toggle source

Returns the item description

@return [String]

# File lib/wordprss/item.rb, line 31
def description
  node.at("description").text
end
published_at() click to toggle source

Returns the item publication date

@return [String]

# File lib/wordprss/item.rb, line 24
def published_at
  node.at("pubDate").text
end
tags() click to toggle source

Returns an array of the item categories

@return [Array<String>]

# File lib/wordprss/item.rb, line 38
def tags
  node.css("category").map(&:text)
end
title() click to toggle source

Returns the item title

@return [String]

# File lib/wordprss/item.rb, line 10
def title
  node.at("title").text
end