Class: DeepL::Requests::Base

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

Overview

rubocop:disable Metrics/ClassLength

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Base.



11
12
13
14
15
16
17
# File 'lib/deepl/requests/base.rb', line 11

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.



9
10
11
# File 'lib/deepl/requests/base.rb', line 9

def api
  @api
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/deepl/requests/base.rb', line 9

def options
  @options
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/deepl/requests/base.rb', line 9

def response
  @response
end

Instance Method Details

#detailsObject



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

def details
  "HTTP Headers #{headers}"
end

#requestObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/deepl/requests/base.rb', line 19

def request
  raise NotImplementedError
end