Class: DeepL::Requests::Document::Download
- Defined in:
- lib/deepl/requests/document/download.rb
Instance Attribute Summary collapse
-
#document_id ⇒ Object
readonly
Returns the value of attribute document_id.
-
#document_key ⇒ Object
readonly
Returns the value of attribute document_key.
Attributes inherited from Base
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(api, document_id, document_key, output_file) ⇒ Download
constructor
A new instance of Download.
- #request ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(api, document_id, document_key, output_file) ⇒ Download
Returns a new instance of Download.
12 13 14 15 16 17 |
# File 'lib/deepl/requests/document/download.rb', line 12 def initialize(api, document_id, document_key, output_file) super(api, {}) @document_id = document_id @document_key = document_key @output_file = output_file end |
Instance Attribute Details
#document_id ⇒ Object (readonly)
Returns the value of attribute document_id.
10 11 12 |
# File 'lib/deepl/requests/document/download.rb', line 10 def document_id @document_id end |
#document_key ⇒ Object (readonly)
Returns the value of attribute document_key.
10 11 12 |
# File 'lib/deepl/requests/document/download.rb', line 10 def document_key @document_key end |
Instance Method Details
#details ⇒ Object
24 25 26 |
# File 'lib/deepl/requests/document/download.rb', line 24 def details "HTTP Headers: #{headers}\nPayload #{{ document_key: document_key }}" end |
#request ⇒ Object
19 20 21 22 |
# File 'lib/deepl/requests/document/download.rb', line 19 def request payload = { document_key: document_key } extract_file(*execute_request_with_retries(post_request(payload))) end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/deepl/requests/document/download.rb', line 28 def to_s "POST #{uri.request_uri}" end |