Class: TumblrClientWrapper::Posts::ApiRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/tumblr_client_wrapper/posts.rb

Instance Method Summary collapse

Constructor Details

#initializeApiRequest

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, options)
    unless options.empty?
        response = @@tumblr_client.posts("#{tumblr_id}.tumblr.com")
    else
        response = @@tumblr_client.posts("#{tumblr_id}.tumblr.com", options)
    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