Class: Lacquer::Configuration
- Inherits:
-
Object
- Object
- Lacquer::Configuration
- Defined in:
- lib/lacquer/configuration.rb
Constant Summary collapse
- OPTIONS =
[]
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.
-
#pass_command ⇒ Object
Pass Command (in vcl_fetch).
-
#purge_command ⇒ Object
Purge Command.
-
#retries ⇒ Object
Number of retries before failing.
-
#use_sudo ⇒ Object
Use sudo for start up.
-
#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.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/lacquer/configuration.rb', line 32 def initialize @enable_cache = true @varnish_servers = [] @default_ttl = 0 @job_backend = :none @retries = 5 @command_error_handler = nil @purge_command = "url.purge" @pass_command = "pass" @use_sudo = false 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 |
#pass_command ⇒ Object
Pass Command (in vcl_fetch)
27 28 29 |
# File 'lib/lacquer/configuration.rb', line 27 def pass_command @pass_command end |
#purge_command ⇒ Object
Purge Command
24 25 26 |
# File 'lib/lacquer/configuration.rb', line 24 def purge_command @purge_command end |
#retries ⇒ Object
Number of retries before failing
15 16 17 |
# File 'lib/lacquer/configuration.rb', line 15 def retries @retries end |
#use_sudo ⇒ Object
Use sudo for start up
30 31 32 |
# File 'lib/lacquer/configuration.rb', line 30 def use_sudo @use_sudo 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
45 46 47 48 49 |
# File 'lib/lacquer/configuration.rb', line 45 def to_hash OPTIONS.inject({}) do |hash, option| hash.merge(option.to_sym => send(option)) end end |