Module: TumblRb::Client::Blogs
- Included in:
- TumblRb::Client
- Defined in:
- lib/tumbl_rb/client/blogs.rb
Instance Method Summary collapse
-
#avatar(blog) ⇒ Hashie::Mash
Get the avatar of a blog.
-
#followers(blog, limit = 20, offset = 0) ⇒ Hashie::Mash
Get the followers of a blog.
-
#info(blog) ⇒ Hashie::Mash
Get the info of a blog.
-
#posts(blog, options = {}) ⇒ Hashie::Mash
Get the posts of a blog.
Instance Method Details
#avatar(blog) ⇒ Hashie::Mash
Get the avatar of a blog
24 25 26 |
# File 'lib/tumbl_rb/client/blogs.rb', line 24 def avatar(blog, size=64) get("/v2/blog/#{Blog.new blog}/avatar/#{size}", {}, false, false) end |
#followers(blog, limit = 20, offset = 0) ⇒ Hashie::Mash
Get the followers of a blog
37 38 39 |
# File 'lib/tumbl_rb/client/blogs.rb', line 37 def followers(blog, limit=20, offset=0) get("/v2/blog/#{Blog.new blog}/followers", { :limit => limit, :offset => offset }, false, false) end |
#info(blog) ⇒ Hashie::Mash
Get the info of a blog
12 13 14 |
# File 'lib/tumbl_rb/client/blogs.rb', line 12 def info(blog) get("/v2/blog/#{Blog.new blog}/info", {}, false, false) end |
#posts(blog, options = {}) ⇒ Hashie::Mash
Get the posts of a blog
61 62 63 64 65 66 67 68 69 |
# File 'lib/tumbl_rb/client/blogs.rb', line 61 def posts(blog, ={}) url = "/v2/blog/#{Blog.new blog}/posts" if ![:type].nil? url += "/#{options[:type]}" end get(url, , false) end |