Class: WP::API::Post
Instance Attribute Summary
Attributes inherited from Resource
#attributes, #headers
Instance Method Summary
collapse
Methods inherited from Resource
#id, #initialize, #meta
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class WP::API::Resource
Instance Method Details
#categories ⇒ Object
13
14
15
|
# File 'lib/wp/api/resources/post.rb', line 13
def categories
terms['category'].collect {|cat| WP::API::Category.new(cat) }
end
|
#content ⇒ Object
9
10
11
|
# File 'lib/wp/api/resources/post.rb', line 9
def content
_remove_entities(super)
end
|
#items ⇒ Object
31
32
33
34
|
# File 'lib/wp/api/resources/post.rb', line 31
def items
items = .select {|rel, url| rel == "item" }
items.empty? ? [] : items.collect(&:last)
end
|
#next ⇒ Object
26
27
28
29
|
# File 'lib/wp/api/resources/post.rb', line 26
def next
item = .find {|rel, url| rel == "next" }
item.last if item
end
|
#prev ⇒ Object
21
22
23
24
|
# File 'lib/wp/api/resources/post.rb', line 21
def prev
item = .find {|rel, url| rel == "prev" }
item.last if item
end
|
17
18
19
|
# File 'lib/wp/api/resources/post.rb', line 17
def tags
terms['post_tag'].collect {|cat| WP::API::Tag.new(cat) }
end
|
#title ⇒ Object
5
6
7
|
# File 'lib/wp/api/resources/post.rb', line 5
def title
_remove_entities(super)
end
|