Module: Underpass

Defined in:
lib/underpass.rb,
lib/underpass/cache.rb,
lib/underpass/shape.rb,
lib/underpass/client.rb,
lib/underpass/errors.rb,
lib/underpass/filter.rb,
lib/underpass/feature.rb,
lib/underpass/matcher.rb,
lib/underpass/version.rb,
lib/underpass/geo_json.rb,
lib/underpass/ql/query.rb,
lib/underpass/way_chain.rb,
lib/underpass/ql/builder.rb,
lib/underpass/ql/request.rb,
lib/underpass/ql/response.rb,
lib/underpass/error_parser.rb,
lib/underpass/configuration.rb,
lib/underpass/ql/bounding_box.rb,
lib/underpass/ql/query_analyzer.rb

Overview

Returns the version of the gem as a Gem::Version

Defined Under Namespace

Modules: GeoJSON, QL, VERSION Classes: ApiError, Cache, Client, Configuration, Error, ErrorParser, Feature, Filter, Matcher, RateLimitError, Shape, TimeoutError, WayChain

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cacheCache?

Returns the cache instance used for storing API responses.

Returns:

  • (Cache, nil)

    the cache instance used for storing API responses



41
42
43
# File 'lib/underpass.rb', line 41

def cache
  @cache
end

.configurationConfiguration

Returns the current configuration, initializing a default one if needed.

Returns:



49
50
51
# File 'lib/underpass.rb', line 49

def configuration
  @configuration ||= Configuration.new
end

Class Method Details

.configure {|config| ... } ⇒ void

This method returns an undefined value.

Yields the current configuration for modification.

Examples:

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

Yields:

  • (config)

    the current configuration

Yield Parameters:



64
65
66
# File 'lib/underpass.rb', line 64

def configure
  yield(configuration)
end

.gem_versionString

Prints the gem version as a string

Returns:

  • (String)


8
9
10
# File 'lib/underpass/version.rb', line 8

def self.gem_version
  Gem::Version.new VERSION::STRING
end

.reset_configuration!Configuration

Resets the configuration to default values.

Returns:



71
72
73
# File 'lib/underpass.rb', line 71

def reset_configuration!
  @configuration = Configuration.new
end