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.
564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/pdfcrowd.rb', line 564 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.5.0 (https://pdfcrowd.com)') @retry_count = 1 @converter_version = '24.04' end |
Instance Method Details
#getConsumedCreditCount ⇒ Object
616 617 618 |
# File 'lib/pdfcrowd.rb', line 616 def getConsumedCreditCount() @consumed_credits end |
#getConverterVersion ⇒ Object
636 637 638 |
# File 'lib/pdfcrowd.rb', line 636 def getConverterVersion() @converter_version end |
#getDebugLogUrl ⇒ Object
608 609 610 |
# File 'lib/pdfcrowd.rb', line 608 def getDebugLogUrl() @debug_log_url end |
#getJobId ⇒ Object
620 621 622 |
# File 'lib/pdfcrowd.rb', line 620 def getJobId() @job_id end |
#getOutputSize ⇒ Object
632 633 634 |
# File 'lib/pdfcrowd.rb', line 632 def getOutputSize() @output_size end |
#getPageCount ⇒ Object
624 625 626 |
# File 'lib/pdfcrowd.rb', line 624 def getPageCount() @page_count end |
#getRemainingCreditCount ⇒ Object
612 613 614 |
# File 'lib/pdfcrowd.rb', line 612 def getRemainingCreditCount() @credits end |
#getTotalPageCount ⇒ Object
628 629 630 |
# File 'lib/pdfcrowd.rb', line 628 def getTotalPageCount() @total_page_count end |
#post(fields, files, raw_data, out_stream = nil) ⇒ Object
578 579 580 581 582 583 |
# File 'lib/pdfcrowd.rb', line 578 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
597 598 599 |
# File 'lib/pdfcrowd.rb', line 597 def setConverterVersion(converter_version) @converter_version = converter_version end |
#setProxy(host, port, user_name, password) ⇒ Object
601 602 603 604 605 606 |
# File 'lib/pdfcrowd.rb', line 601 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
593 594 595 |
# File 'lib/pdfcrowd.rb', line 593 def setRetryCount(retry_count) @retry_count = retry_count end |
#setUseHttp(use_http) ⇒ Object
585 586 587 |
# File 'lib/pdfcrowd.rb', line 585 def setUseHttp(use_http) @use_http = use_http end |
#setUserAgent(user_agent) ⇒ Object
589 590 591 |
# File 'lib/pdfcrowd.rb', line 589 def setUserAgent(user_agent) @user_agent = user_agent end |