Class: Wordpress::WXR::Category
Instance Method Summary
collapse
Methods inherited from Element
#initialize
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?
22
23
24
25
|
# File 'lib/wordpress/wxr/category.rb', line 22
def ==(other)
self.class == other.class &&
id == other.id
end
|
#id ⇒ Object
6
7
8
|
# File 'lib/wordpress/wxr/category.rb', line 6
def id
Integer(node.xpath('wp:term_id').text)
end
|
#name ⇒ Object
18
19
20
|
# File 'lib/wordpress/wxr/category.rb', line 18
def name
node.xpath('wp:cat_name').text
end
|
#nicename ⇒ Object
10
11
12
|
# File 'lib/wordpress/wxr/category.rb', line 10
def nicename
node.xpath('wp:category_nicename').text
end
|
#parent ⇒ Object
14
15
16
|
# File 'lib/wordpress/wxr/category.rb', line 14
def parent
wxr.categories.find_by(nicename: node.xpath('wp:category_parent').text)
end
|