Class: Lacquer::Configuration
- Inherits:
-
Object
- Object
- Lacquer::Configuration
- Defined in:
- lib/lacquer/configuration.rb
Constant Summary collapse
- OPTIONS =
[ :varnish_servers ]
Instance Attribute Summary collapse
-
#command_error_handler ⇒ Object
Error handler.
-
#default_ttl ⇒ Object
Application default ttl.
-
#enable_cache ⇒ Object
Enable cache.
-
#job_backend ⇒ Object
Job Backend.
-
#retries ⇒ Object
Application default ttl.
-
#varnish_servers ⇒ Object
Varnish servers.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#to_hash ⇒ Object
Returns a hash of all configurable options.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 26 27 28 29 30 |
# File 'lib/lacquer/configuration.rb', line 23 def initialize @enable_cache = true @varnish_servers = [] @default_ttl = 0 @job_backend = :none @retries = 5 @command_error_handler = nil end |
Instance Attribute Details
#command_error_handler ⇒ Object
Error handler
21 22 23 |
# File 'lib/lacquer/configuration.rb', line 21 def command_error_handler @command_error_handler end |
#default_ttl ⇒ Object
Application default ttl
12 13 14 |
# File 'lib/lacquer/configuration.rb', line 12 def default_ttl @default_ttl end |
#enable_cache ⇒ Object
Enable cache
6 7 8 |
# File 'lib/lacquer/configuration.rb', line 6 def enable_cache @enable_cache end |
#job_backend ⇒ Object
Job Backend
18 19 20 |
# File 'lib/lacquer/configuration.rb', line 18 def job_backend @job_backend end |
#retries ⇒ Object
Application default ttl
15 16 17 |
# File 'lib/lacquer/configuration.rb', line 15 def retries @retries end |
#varnish_servers ⇒ Object
Varnish servers
9 10 11 |
# File 'lib/lacquer/configuration.rb', line 9 def varnish_servers @varnish_servers end |
Instance Method Details
#to_hash ⇒ Object
Returns a hash of all configurable options
33 34 35 36 37 |
# File 'lib/lacquer/configuration.rb', line 33 def to_hash OPTIONS.inject({}) do |hash, option| hash.merge(option.to_sym => send(option)) end end |