Class: Locality::Configuration
- Inherits:
-
Object
- Object
- Locality::Configuration
- Defined in:
- lib/locality/configuration.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #add_custom_ip_location(ip, data) ⇒ Object
- #custom_ip_locations ⇒ Object
- #maxmind_geoip2_paths ⇒ Object
- #postnummerfilen_paths ⇒ Object
Instance Attribute Details
#maxmind_geoip2_path ⇒ Object
18 19 20 |
# File 'lib/locality/configuration.rb', line 18 def maxmind_geoip2_path maxmind_geoip2_paths.detect &:readable? end |
#postnummerfilen_path ⇒ Object
30 31 32 |
# File 'lib/locality/configuration.rb', line 30 def postnummerfilen_path postnummerfilen_paths.detect &:readable? end |
Instance Method Details
#add_custom_ip_location(ip, data) ⇒ Object
14 15 16 |
# File 'lib/locality/configuration.rb', line 14 def add_custom_ip_location(ip, data) custom_ip_locations[IPAddr.new(ip)] = data.to_hash end |
#custom_ip_locations ⇒ Object
10 11 12 |
# File 'lib/locality/configuration.rb', line 10 def custom_ip_locations @custom_ip_locations ||= {} end |
#maxmind_geoip2_paths ⇒ Object
22 23 24 |
# File 'lib/locality/configuration.rb', line 22 def maxmind_geoip2_paths paths maxmind_geoip2_filename, custom_maxmind_geoip2_path end |
#postnummerfilen_paths ⇒ Object
34 35 36 |
# File 'lib/locality/configuration.rb', line 34 def postnummerfilen_paths paths postnummerfilen_filename, custom_postnummerfilen_path end |