Class: SoraGeocoding::Base
- Inherits:
-
Object
- Object
- SoraGeocoding::Base
- Defined in:
- lib/sora_geocoding/base.rb
Instance Method Summary collapse
-
#configuration ⇒ Object
specific config data.
-
#handle ⇒ Object
Symbol which is used in configuration to refer to this Lookup.
-
#raise_error(error, message = nil) ⇒ Object
Raise exception.
Instance Method Details
#configuration ⇒ Object
specific config data
16 17 18 |
# File 'lib/sora_geocoding/base.rb', line 16 def configuration SoraGeocoding.config_for_lookup(handle) end |
#handle ⇒ Object
Symbol which is used in configuration to refer to this Lookup.
8 9 10 11 |
# File 'lib/sora_geocoding/base.rb', line 8 def handle str = self.class.to_s str[str.rindex(':') + 1..-1].gsub(/([a-z\d]+)([A-Z])/, '\1_\2').downcase.to_sym end |
#raise_error(error, message = nil) ⇒ Object
Raise exception. Return false if exception not raised.
24 25 26 27 28 29 |
# File 'lib/sora_geocoding/base.rb', line 24 def raise_error(error, = nil) exceptions = configuration.always_raise raise error, if (exceptions == :all) || exceptions.include?(error.is_a?(Class) ? error : error.class) false end |