Class: WpRpc::Collection::Posts
- Defined in:
- lib/wp_rpc/collections/posts.rb
Instance Method Summary collapse
- #all ⇒ Object
- #find(qid, options = { }) ⇒ Object
- #find_recent(options = { }) ⇒ Object
- #new(attributes = { }) ⇒ Object
Methods inherited from Base
#change_attributes, #conn, #initialize, #pattern
Constructor Details
This class inherits a constructor from WpRpc::Base
Instance Method Details
#all ⇒ Object
25 26 27 |
# File 'lib/wp_rpc/collections/posts.rb', line 25 def all change_attributes(conn.call('wp.getPosts', conn.blog_id, conn.username, conn.password), pattern) end |
#find(qid, options = { }) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/wp_rpc/collections/posts.rb', line 10 def find(qid, = { }) if qid.is_a?(Array) qid.collect { |sqid| find(sqid) } elsif qid == :recent find_recent() else post = conn.get_post(qid) Post.new(post, :conn => conn) end end |