Class: Underpass::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/underpass/configuration.rb

Overview

Stores configuration options for the Underpass library.

Examples:

Underpass.configure do |config|
  config.api_endpoint = 'https://overpass.kumi.systems/api/interpreter'
  config.timeout = 30
  config.max_retries = 5
end

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



22
23
24
25
26
# File 'lib/underpass/configuration.rb', line 22

def initialize
  @api_endpoint = 'https://overpass-api.de/api/interpreter'
  @timeout = 25
  @max_retries = 3
end

Instance Attribute Details

#api_endpointString

Returns the Overpass API endpoint URL.

Returns:

  • (String)

    the Overpass API endpoint URL



14
15
16
# File 'lib/underpass/configuration.rb', line 14

def api_endpoint
  @api_endpoint
end

#max_retriesInteger

Returns maximum number of retry attempts for rate limiting and timeouts.

Returns:

  • (Integer)

    maximum number of retry attempts for rate limiting and timeouts



20
21
22
# File 'lib/underpass/configuration.rb', line 20

def max_retries
  @max_retries
end

#timeoutInteger

Returns the query timeout in seconds.

Returns:

  • (Integer)

    the query timeout in seconds



17
18
19
# File 'lib/underpass/configuration.rb', line 17

def timeout
  @timeout
end