Module: WordpressApi::Api::Reader

Included in:
Client
Defined in:
lib/wordpress_api/api/reader.rb

Instance Method Summary collapse

Instance Method Details

#blog(blog_id, options = {}) ⇒ Object



11
12
13
14
# File 'lib/wordpress_api/api/reader.rb', line 11

def blog(blog_id, options={})
  path = "/sites/#{blog_id}"
  Mash.from_json(get path, options)
end

#comments(blog_id, post_id, options = {}) ⇒ Object



26
27
28
29
# File 'lib/wordpress_api/api/reader.rb', line 26

def comments(blog_id, post_id, options={})
  path = "/sites/#{blog_id}/posts/#{post_id}/replies"
  Mash.from_json(get path, options)
end

#followers(blog_id, options = {}) ⇒ Object



31
32
33
34
# File 'lib/wordpress_api/api/reader.rb', line 31

def followers(blog_id, options={})
  path = "/sites/#{blog_id}/follows/mine"
  Mash.from_json(get path, options)
end

#likes(blog_id, post_id, options = {}) ⇒ Object



21
22
23
24
# File 'lib/wordpress_api/api/reader.rb', line 21

def likes(blog_id, post_id, options={})
  path = "/sites/#{blog_id}/posts/#{post_id}/likes"
  Mash.from_json(get path, options)
end

#posts(blog_id, options = {}) ⇒ Object



16
17
18
19
# File 'lib/wordpress_api/api/reader.rb', line 16

def posts(blog_id, options={})
  path = "/sites/#{blog_id}/posts"
  Mash.from_json(get path, options)
end

#profile(options = {}) ⇒ Object



6
7
8
9
# File 'lib/wordpress_api/api/reader.rb', line 6

def profile(options={})
  path = "/me"
  Mash.from_json(get path, options)
end