Class: EarthTools::Configuration
- Inherits:
-
Object
- Object
- EarthTools::Configuration
- Includes:
- Singleton
- Defined in:
- lib/earth_tools/configuration.rb
Constant Summary collapse
- OPTIONS =
[ :timeout, :proxy, :cache, :cache_prefix, :always_raise, :units ]
Class Method Summary collapse
-
.set_defaults ⇒ Object
This method will set the configuration options to the default values.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
:nodoc.
-
#set_defaults ⇒ Object
This method will set the configuration options to the default values.
Constructor Details
#initialize ⇒ Configuration
:nodoc
29 30 31 |
# File 'lib/earth_tools/configuration.rb', line 29 def initialize # :nodoc set_defaults end |
Class Method Details
.set_defaults ⇒ Object
This method will set the configuration options to the default values
67 68 69 |
# File 'lib/earth_tools/configuration.rb', line 67 def set_defaults instance.set_defaults end |
Instance Method Details
#set_defaults ⇒ Object
This method will set the configuration options to the default values
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/earth_tools/configuration.rb', line 34 def set_defaults @timeout = 3 # geocoding service timeout (secs) @proxy = nil # HTTP proxy server (user:pass@host:port) @cache = nil # cache object (must respond to #[], #[]=, and #keys) @cache_prefix = "earth_tools:" # prefix (string) to use for all cache keys # exceptions that should not be rescued by default # (if you want to implement custom error handling); # supports SocketError and Timeout::Error @always_raise = [] # calculation options @units = :english # :metric or :english end |