class Wordpress::WXR::Posts

Attributes

document[R]
wxr[R]

Public Class Methods

new(document, wxr) click to toggle source
# File lib/wordpress/wxr/posts.rb, line 11
def initialize(document, wxr)
  @document = document
  @wxr = wxr
end

Public Instance Methods

each() { |post| ... } click to toggle source
# File lib/wordpress/wxr/posts.rb, line 16
def each
  return enum_for(:each) unless block_given?

  nodes.each do |node|
    yield Post.new(node, wxr)
  end
end

Private Instance Methods

nodes() click to toggle source
# File lib/wordpress/wxr/posts.rb, line 26
def nodes
  document.xpath("//item[wp:post_type = 'post']")
end