lib/wp2middleman/post.rb in wp2middleman-0.0.2 vs lib/wp2middleman/post.rb in wp2middleman-0.0.3
- old
+ new
@@ -11,11 +11,11 @@
def title
post.css('title').text
end
def valid?
- !(post_date.nil? || title.nil? || date_published.nil? || content.nil?)
+ !(post_date.nil? || title.nil? || date_time_published.nil? || content.nil?)
end
def attachment?
type == 'attachment'
end
@@ -28,9 +28,13 @@
post.xpath("wp:post_date").first.inner_text
end
def date_published
Date.parse(post_date).to_s
+ end
+
+ def date_time_published
+ Time.parse(post_date).strftime("%F %T")
end
def status
post.xpath("wp:status").first.inner_text
end