Class: TumblrClientWrapper::Posts::ApiRequest
- Inherits:
-
Object
- Object
- TumblrClientWrapper::Posts::ApiRequest
- Defined in:
- lib/tumblr_client_wrapper/posts.rb
Instance Method Summary collapse
- #get_posts(tumblr_id, options) ⇒ Object
-
#initialize ⇒ ApiRequest
constructor
A new instance of ApiRequest.
- #paginate(tumbld_id, offset) ⇒ Object
Constructor Details
#initialize ⇒ ApiRequest
Returns a new instance of ApiRequest.
9 10 11 |
# File 'lib/tumblr_client_wrapper/posts.rb', line 9 def initialize @@tumblr_client = Tumblr::Client.new(client: :httpclient) end |
Instance Method Details
#get_posts(tumblr_id, options) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/tumblr_client_wrapper/posts.rb', line 13 def get_posts(tumblr_id, ) unless .empty? response = @@tumblr_client.posts("#{tumblr_id}.tumblr.com") else response = @@tumblr_client.posts("#{tumblr_id}.tumblr.com", ) end end |
#paginate(tumbld_id, offset) ⇒ Object
21 22 23 |
# File 'lib/tumblr_client_wrapper/posts.rb', line 21 def paginate(tumbld_id, offset) response = @@tumblr_client.posts("#{tumblr_id}.tumblr.com", offset: offset) end |