Class: DeepL::Requests::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/deepl/requests/base.rb

Overview

rubocop:disable Metrics/ClassLength

Constant Summary collapse

MAX_GLOSSARY_IDS =

Maximum number of glossaries that may be provided via the glossary_ids option.

5

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api, options = {}, additional_headers = {}) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
19
20
# File 'lib/deepl/requests/base.rb', line 14

def initialize(api, options = {}, additional_headers = {})
  @api = api
  @options = options
  @additional_headers = additional_headers
  @num_retries = 0
  @backoff_timer = Utils::BackoffTimer.new
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



12
13
14
# File 'lib/deepl/requests/base.rb', line 12

def api
  @api
end

#optionsObject (readonly)

Returns the value of attribute options.



12
13
14
# File 'lib/deepl/requests/base.rb', line 12

def options
  @options
end

#responseObject (readonly)

Returns the value of attribute response.



12
13
14
# File 'lib/deepl/requests/base.rb', line 12

def response
  @response
end

Instance Method Details

#detailsObject



26
27
28
# File 'lib/deepl/requests/base.rb', line 26

def details
  "HTTP Headers #{headers}"
end

#requestObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/deepl/requests/base.rb', line 22

def request
  raise NotImplementedError
end