Class: IpFilter::Configuration
- Inherits:
-
Object
- Object
- IpFilter::Configuration
- Defined in:
- lib/ip_filter/configuration.rb
Instance Attribute Summary collapse
-
#allow_loopback ⇒ Object
Returns the value of attribute allow_loopback.
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#cache_prefix ⇒ Object
Returns the value of attribute cache_prefix.
-
#data_folder ⇒ Object
Returns the value of attribute data_folder.
-
#geo_ip_dat ⇒ Object
Returns the value of attribute geo_ip_dat.
-
#geoip_level ⇒ Object
Returns the value of attribute geoip_level.
-
#geoipupdate_config ⇒ Object
Returns the value of attribute geoipupdate_config.
-
#ip_code_type ⇒ Object
Returns the value of attribute ip_code_type.
-
#ip_codes ⇒ Object
Returns the value of attribute ip_codes.
-
#ip_exception ⇒ Object
Returns the value of attribute ip_exception.
-
#ip_whitelist ⇒ Object
Returns the value of attribute ip_whitelist.
-
#refresh_delay ⇒ Object
Returns the value of attribute refresh_delay.
-
#s3_access_key_id ⇒ Object
Returns the value of attribute s3_access_key_id.
-
#s3_bucket_name ⇒ Object
Returns the value of attribute s3_bucket_name.
-
#s3_secret_access_key ⇒ Object
Returns the value of attribute s3_secret_access_key.
-
#update_method ⇒ Object
Returns the value of attribute update_method.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ip_filter/configuration.rb', line 9 def initialize # Folder containing GeoIP database files. @data_folder = '/tmp/geoip' # Level of filtering : Country, city... @geo_ip_dat = 'data/GeoIP.dat' @geoip_level = :country # Logic to use to update geoip.dat file @update_method = [] # Must be 'country_code', 'country_code2', 'country_code3', # 'country_name', 'continent_code' @ip_code_type = nil # Must be of the corresponding format as :ip_code_type @ip_codes = [] # Whitelist of IPs @ip_whitelist = [] # Exceptions that should not be rescued by default # (if you want to implement custom error handling); @ip_exception = Exception.new # Allow loopback Ip @allow_loopback = true # cache object (must respond to #[], #[]=, and #keys) @cache = nil # prefix (string) to use for all cache keys @cache_prefix = 'ip_filter:' # Configuration path for geoipupdate binary @geoipupdate_config = '/usr/local/etc/GeoIP.conf' ## S3 credentials ## # if access_key_id is nil, S3 isn't loaded. @s3_access_key_id = nil # S3 Secret API key @s3_secret_access_key = nil # S3 bucket name @s3_bucket_name = 'ip_filter-geoip' # Cache refresh delay, every 24 hours by default @refresh_delay = 86400 end |
Instance Attribute Details
#allow_loopback ⇒ Object
Returns the value of attribute allow_loopback.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def allow_loopback @allow_loopback end |
#cache ⇒ Object
Returns the value of attribute cache.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def cache @cache end |
#cache_prefix ⇒ Object
Returns the value of attribute cache_prefix.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def cache_prefix @cache_prefix end |
#data_folder ⇒ Object
Returns the value of attribute data_folder.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def data_folder @data_folder end |
#geo_ip_dat ⇒ Object
Returns the value of attribute geo_ip_dat.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def geo_ip_dat @geo_ip_dat end |
#geoip_level ⇒ Object
Returns the value of attribute geoip_level.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def geoip_level @geoip_level end |
#geoipupdate_config ⇒ Object
Returns the value of attribute geoipupdate_config.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def geoipupdate_config @geoipupdate_config end |
#ip_code_type ⇒ Object
Returns the value of attribute ip_code_type.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def ip_code_type @ip_code_type end |
#ip_codes ⇒ Object
Returns the value of attribute ip_codes.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def ip_codes @ip_codes end |
#ip_exception ⇒ Object
Returns the value of attribute ip_exception.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def ip_exception @ip_exception end |
#ip_whitelist ⇒ Object
Returns the value of attribute ip_whitelist.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def ip_whitelist @ip_whitelist end |
#refresh_delay ⇒ Object
Returns the value of attribute refresh_delay.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def refresh_delay @refresh_delay end |
#s3_access_key_id ⇒ Object
Returns the value of attribute s3_access_key_id.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def s3_access_key_id @s3_access_key_id end |
#s3_bucket_name ⇒ Object
Returns the value of attribute s3_bucket_name.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def s3_bucket_name @s3_bucket_name end |
#s3_secret_access_key ⇒ Object
Returns the value of attribute s3_secret_access_key.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def s3_secret_access_key @s3_secret_access_key end |
#update_method ⇒ Object
Returns the value of attribute update_method.
3 4 5 |
# File 'lib/ip_filter/configuration.rb', line 3 def update_method @update_method end |