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/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, 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



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

def cache
  @cache
end

.configurationConfiguration

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

Returns:



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

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:



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

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:



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

def reset_configuration!
  @configuration = Configuration.new
end