Class: SelectPdf::UsageClient
Overview
Get usage details for SelectPdf Online API.
Instance Attribute Summary
Attributes inherited from ApiClient
#api_async_endpoint, #api_endpoint, #api_web_elements_endpoint, #async_calls_max_pings, #async_calls_ping_interval, #number_of_pages
Instance Method Summary collapse
-
#get_usage(get_history = false) ⇒ Object
Get API usage information with history if specified.
-
#initialize(api_key) ⇒ UsageClient
constructor
Construct the Usage client.
Constructor Details
#initialize(api_key) ⇒ UsageClient
Construct the Usage client.
297 298 299 300 301 |
# File 'lib/selectpdf.rb', line 297 def initialize(api_key) super() @api_endpoint = 'https://selectpdf.com/api2/usage/' @parameters['key'] = api_key end |
Instance Method Details
#get_usage(get_history = false) ⇒ Object
Get API usage information with history if specified.
307 308 309 310 311 312 313 |
# File 'lib/selectpdf.rb', line 307 def get_usage(get_history = false) @headers['Accept'] = 'text/json' @parameters['get_history'] = 'True' if get_history result = perform_post JSON.parse(result) end |