Class: Pdfcrowd::ConnectionHelper
- Inherits:
-
Object
- Object
- Pdfcrowd::ConnectionHelper
- Defined in:
- lib/pdfcrowd.rb
Instance Method Summary collapse
- #getConsumedCreditCount ⇒ Object
- #getConverterVersion ⇒ Object
- #getDebugLogUrl ⇒ Object
- #getJobId ⇒ Object
- #getOutputSize ⇒ Object
- #getPageCount ⇒ Object
- #getRemainingCreditCount ⇒ Object
- #getTotalPageCount ⇒ Object
-
#initialize(user_name, api_key) ⇒ ConnectionHelper
constructor
A new instance of ConnectionHelper.
- #post(fields, files, raw_data, out_stream = nil) ⇒ Object
- #setConverterVersion(converter_version) ⇒ Object
- #setProxy(host, port, user_name, password) ⇒ Object
- #setRetryCount(retry_count) ⇒ Object
- #setUseHttp(use_http) ⇒ Object
- #setUserAgent(user_agent) ⇒ Object
Constructor Details
#initialize(user_name, api_key) ⇒ ConnectionHelper
Returns a new instance of ConnectionHelper.
536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/pdfcrowd.rb', line 536 def initialize(user_name, api_key) @user_name = user_name @api_key = api_key reset_response_data() setProxy(nil, nil, nil, nil) setUseHttp(false) setUserAgent('pdfcrowd_ruby_client/6.2.0 (https://pdfcrowd.com)') @retry_count = 1 @converter_version = '24.04' end |
Instance Method Details
#getConsumedCreditCount ⇒ Object
588 589 590 |
# File 'lib/pdfcrowd.rb', line 588 def getConsumedCreditCount() @consumed_credits end |
#getConverterVersion ⇒ Object
608 609 610 |
# File 'lib/pdfcrowd.rb', line 608 def getConverterVersion() @converter_version end |
#getDebugLogUrl ⇒ Object
580 581 582 |
# File 'lib/pdfcrowd.rb', line 580 def getDebugLogUrl() @debug_log_url end |
#getJobId ⇒ Object
592 593 594 |
# File 'lib/pdfcrowd.rb', line 592 def getJobId() @job_id end |
#getOutputSize ⇒ Object
604 605 606 |
# File 'lib/pdfcrowd.rb', line 604 def getOutputSize() @output_size end |
#getPageCount ⇒ Object
596 597 598 |
# File 'lib/pdfcrowd.rb', line 596 def getPageCount() @page_count end |
#getRemainingCreditCount ⇒ Object
584 585 586 |
# File 'lib/pdfcrowd.rb', line 584 def getRemainingCreditCount() @credits end |
#getTotalPageCount ⇒ Object
600 601 602 |
# File 'lib/pdfcrowd.rb', line 600 def getTotalPageCount() @total_page_count end |
#post(fields, files, raw_data, out_stream = nil) ⇒ Object
550 551 552 553 554 555 |
# File 'lib/pdfcrowd.rb', line 550 def post(fields, files, raw_data, out_stream = nil) request = create_request() request.body = ConnectionHelper.encode_multipart_post_data(fields, files, raw_data) request.content_type = 'multipart/form-data; boundary=' + MULTIPART_BOUNDARY do_post(request, out_stream) end |
#setConverterVersion(converter_version) ⇒ Object
569 570 571 |
# File 'lib/pdfcrowd.rb', line 569 def setConverterVersion(converter_version) @converter_version = converter_version end |
#setProxy(host, port, user_name, password) ⇒ Object
573 574 575 576 577 578 |
# File 'lib/pdfcrowd.rb', line 573 def setProxy(host, port, user_name, password) @proxy_host = host @proxy_port = port @proxy_user_name = user_name @proxy_password = password end |
#setRetryCount(retry_count) ⇒ Object
565 566 567 |
# File 'lib/pdfcrowd.rb', line 565 def setRetryCount(retry_count) @retry_count = retry_count end |
#setUseHttp(use_http) ⇒ Object
557 558 559 |
# File 'lib/pdfcrowd.rb', line 557 def setUseHttp(use_http) @use_http = use_http end |
#setUserAgent(user_agent) ⇒ Object
561 562 563 |
# File 'lib/pdfcrowd.rb', line 561 def setUserAgent(user_agent) @user_agent = user_agent end |