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.
453 454 455 456 457 |
# File 'lib/selectpdf.rb', line 453 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.
463 464 465 466 467 468 469 |
# File 'lib/selectpdf.rb', line 463 def get_usage(get_history = false) @headers['Accept'] = 'text/json' @parameters['get_history'] = 'True' if get_history result = perform_post JSON.parse(result) end |