Class: Wordpress::WXR::Comment
Instance Method Summary
collapse
Methods inherited from Element
#initialize
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
32
33
34
35
36
37
|
# File 'lib/wordpress/wxr/comment.rb', line 32
def ==(other)
self.class == other.class &&
email == other.email &&
date == other.date &&
content == other.content
end
|
#approved? ⇒ Boolean
28
29
30
|
# File 'lib/wordpress/wxr/comment.rb', line 28
def approved?
node.xpath('wp:comment_approved').text.to_i == 1
end
|
#author ⇒ Object
8
9
10
|
# File 'lib/wordpress/wxr/comment.rb', line 8
def author
node.xpath('wp:comment_author').text
end
|
#content ⇒ Object
24
25
26
|
# File 'lib/wordpress/wxr/comment.rb', line 24
def content
node.xpath('wp:comment_content').text
end
|
#date ⇒ Object
20
21
22
|
# File 'lib/wordpress/wxr/comment.rb', line 20
def date
DateTime.parse(node.xpath('wp:comment_date').text)
end
|
#email ⇒ Object
12
13
14
|
# File 'lib/wordpress/wxr/comment.rb', line 12
def email
Mail::Address.new(node.xpath('wp:comment_author_email').text)
end
|
#url ⇒ Object
16
17
18
|
# File 'lib/wordpress/wxr/comment.rb', line 16
def url
URI(node.xpath('wp:comment_author_url').text)
end
|