Class: SelectPdf::ApiClient
- Inherits:
-
Object
- Object
- SelectPdf::ApiClient
- Defined in:
- lib/selectpdf.rb
Overview
Base class for API clients. Do not use this directly.
Direct Known Subclasses
AsyncJobClient, HtmlToPdfClient, PdfMergeClient, PdfToTextClient, UsageClient, WebElementsClient
Instance Attribute Summary collapse
-
#api_async_endpoint ⇒ Object
API async jobs endpoint.
-
#api_endpoint ⇒ Object
API endpoint.
-
#api_web_elements_endpoint ⇒ Object
API web elements endpoint.
-
#async_calls_max_pings ⇒ Object
Maximum number of pings for asynchronous calls.
-
#async_calls_ping_interval ⇒ Object
Ping interval in seconds for asynchronous calls.
-
#number_of_pages ⇒ Object
readonly
Number of pages of the pdf document resulted from the conversion.
Instance Method Summary collapse
-
#initialize ⇒ ApiClient
constructor
Class constructor.
Constructor Details
#initialize ⇒ ApiClient
Class constructor
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
# File 'lib/selectpdf.rb', line 229 def initialize # API endpoint @api_endpoint = 'https://selectpdf.com/api2/convert/' # API async jobs endpoint @api_async_endpoint = 'https://selectpdf.com/api2/asyncjob/' # API web elements endpoint @api_web_elements_endpoint = 'https://selectpdf.com/api2/webelements/' # Parameters that will be sent to the API. @parameters = {} # HTTP Headers that will be sent to the API. @headers = {} # Files that will be sent to the API. @files = {} # Binary data that will be sent to the API. @binary_data = {} # Number of pages of the pdf document resulted from the conversion. @number_of_pages = 0 # Job ID for asynchronous calls or for calls that require a second request. @job_id = '' # Ping interval in seconds for asynchronous calls. Default value is 3 seconds. @async_calls_ping_interval = 3 # Maximum number of pings for asynchronous calls. Default value is 1,000 pings. @async_calls_max_pings = 1000 end |
Instance Attribute Details
#api_async_endpoint ⇒ Object
API async jobs endpoint
202 203 204 |
# File 'lib/selectpdf.rb', line 202 def api_async_endpoint @api_async_endpoint end |
#api_endpoint ⇒ Object
API endpoint
196 197 198 |
# File 'lib/selectpdf.rb', line 196 def api_endpoint @api_endpoint end |
#api_web_elements_endpoint ⇒ Object
API web elements endpoint
208 209 210 |
# File 'lib/selectpdf.rb', line 208 def api_web_elements_endpoint @api_web_elements_endpoint end |
#async_calls_max_pings ⇒ Object
Maximum number of pings for asynchronous calls. Default value is 1,000 pings.
220 221 222 |
# File 'lib/selectpdf.rb', line 220 def async_calls_max_pings @async_calls_max_pings end |
#async_calls_ping_interval ⇒ Object
Ping interval in seconds for asynchronous calls. Default value is 3 seconds.
214 215 216 |
# File 'lib/selectpdf.rb', line 214 def async_calls_ping_interval @async_calls_ping_interval end |
#number_of_pages ⇒ Object (readonly)
Number of pages of the pdf document resulted from the conversion.
226 227 228 |
# File 'lib/selectpdf.rb', line 226 def number_of_pages @number_of_pages end |