Class: Billy::Config
- Inherits:
-
Object
- Object
- Billy::Config
- Defined in:
- lib/billy/config.rb
Constant Summary collapse
- DEFAULT_WHITELIST =
['127.0.0.1', 'localhost']
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#cache_path ⇒ Object
Returns the value of attribute cache_path.
-
#cache_request_headers ⇒ Object
Returns the value of attribute cache_request_headers.
-
#ignore_cache_port ⇒ Object
Returns the value of attribute ignore_cache_port.
-
#ignore_params ⇒ Object
Returns the value of attribute ignore_params.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#non_successful_cache_disabled ⇒ Object
Returns the value of attribute non_successful_cache_disabled.
-
#non_successful_error_level ⇒ Object
Returns the value of attribute non_successful_error_level.
-
#non_whitelisted_requests_disabled ⇒ Object
Returns the value of attribute non_whitelisted_requests_disabled.
-
#path_blacklist ⇒ Object
Returns the value of attribute path_blacklist.
-
#persist_cache ⇒ Object
Returns the value of attribute persist_cache.
-
#whitelist ⇒ Object
Returns the value of attribute whitelist.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
12 13 14 15 |
# File 'lib/billy/config.rb', line 12 def initialize @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) reset end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def cache @cache end |
#cache_path ⇒ Object
Returns the value of attribute cache_path.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def cache_path @cache_path end |
#cache_request_headers ⇒ Object
Returns the value of attribute cache_request_headers.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def cache_request_headers @cache_request_headers end |
#ignore_cache_port ⇒ Object
Returns the value of attribute ignore_cache_port.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def ignore_cache_port @ignore_cache_port end |
#ignore_params ⇒ Object
Returns the value of attribute ignore_params.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def ignore_params @ignore_params end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def logger @logger end |
#non_successful_cache_disabled ⇒ Object
Returns the value of attribute non_successful_cache_disabled.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def non_successful_cache_disabled @non_successful_cache_disabled end |
#non_successful_error_level ⇒ Object
Returns the value of attribute non_successful_error_level.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def non_successful_error_level @non_successful_error_level end |
#non_whitelisted_requests_disabled ⇒ Object
Returns the value of attribute non_whitelisted_requests_disabled.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def non_whitelisted_requests_disabled @non_whitelisted_requests_disabled end |
#path_blacklist ⇒ Object
Returns the value of attribute path_blacklist.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def path_blacklist @path_blacklist end |
#persist_cache ⇒ Object
Returns the value of attribute persist_cache.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def persist_cache @persist_cache end |
#whitelist ⇒ Object
Returns the value of attribute whitelist.
8 9 10 |
# File 'lib/billy/config.rb', line 8 def whitelist @whitelist end |
Instance Method Details
#reset ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/billy/config.rb', line 17 def reset @cache = true @cache_request_headers = false @whitelist = DEFAULT_WHITELIST @path_blacklist = [] @ignore_params = [] @persist_cache = false @ignore_cache_port = true @non_successful_cache_disabled = false @non_successful_error_level = :warn @non_whitelisted_requests_disabled = false @cache_path = File.join(Dir.tmpdir, 'puffing-billy') end |