Skip to content

Commit

Permalink
Call process method into shorten and lookup method, not in request me…
Browse files Browse the repository at this point in the history
…thod
  • Loading branch information
Fabien Dobat committed Apr 27, 2016
1 parent 6bcf101 commit a609a39
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/polr/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ def self.process
end

def self.request path, params
Api.process { RestClient.get( Api::api_url(path.to_s), { params: params.merge(key: Api::api_key, response_type: :json), content_type: :json, accept: :json, timeout: 10 } ) }
RestClient.get( Api::api_url(path.to_s), { params: params.merge(key: Api::api_key, response_type: :json), content_type: :json, accept: :json, timeout: 10 } )
end
end

# Actions to use

def self.shorten url, **options
Api::request(:shorten, { url: url }.merge(options))
Api::process { Api::request(:shorten, { url: url }.merge(options)) }
end

def self.lookup url_ending, **options
Api::request(:lookup, { url_ending: url_ending }.merge(options))
Api::process { Api::request(:lookup, { url_ending: url_ending }.merge(options)) }
end
end

0 comments on commit a609a39

Please sign in to comment.