README.md in 3scale_client-2.8.2 vs README.md in 3scale_client-2.9.0
- old
+ new
@@ -10,11 +10,12 @@
Rate Limiting: https://support.3scale.net/howtos/basics/provision-rate-limits
Analytics Setup: https://support.3scale.net/quickstarts/3scale-api-analytics
## Installation
-This library is distributed as a gem:
+This library is distributed as a gem, for which Ruby 2.1 or JRuby 9.1.1.0 are
+minimum requirements:
```sh
gem install 3scale_client
```
Or alternatively, download the source code from github:
http://github.com/3scale/3scale_ws_api_for_ruby
@@ -90,22 +91,22 @@
```ruby
class ApplicationController < ActionController
# Call the authenticate method on each request to the API
before_filter :authenticate
-
+
# You only need to instantiate a new Client once and store it as a global variable
# You should store your provider key in the environment because this key is secret!
def create_client
- @@threescale_client ||= ThreeScale::Client.new(:provider_key => ENV['PROVIDER_KEY'])
+ @@threescale_client ||= ThreeScale::Client.new(:provider_key => ENV['PROVIDER_KEY'])
end
-
- # To record usage, create a new metric in your application plan. You will use the
- # "system name" that you specifed on the metric/method to pass in as the key to the usage hash.
- # The key needs to be a symbol.
+
+ # To record usage, create a new metric in your application plan. You will use the
+ # "system name" that you specifed on the metric/method to pass in as the key to the usage hash.
+ # The key needs to be a symbol.
# A way to pass the metric is to add a parameter that will pass the name of the metric/method along
def authenticate
- response = create_client.authrep(:app_id => params["app_id"],
+ response = create_client.authrep(:app_id => params["app_id"],
:app_key => params["app_key"],
:usage => { params[:metric].to_sym => 1 })
if response.success?
return true
# All fine, the usage will be reported automatically. Proceeed.