Sha256: 5412caf77f8be8449f3fd2e511f6efa79ee5afca28dfe82534767e230e156006

Contents?: true

Size: 792 Bytes

Versions: 1

Compression:

Stored size: 792 Bytes

Contents

module Lacquer
  class Configuration
    OPTIONS = [ :varnish_servers ]

    # Enable cache
    attr_accessor :enable_cache

    # Varnish servers
    attr_accessor :varnish_servers

    # Application default ttl
    attr_accessor :default_ttl

    # Application default ttl
    attr_accessor :retries

    # Job Backend
    attr_accessor :job_backend
    
    # Error handler
    attr_accessor :command_error_handler

    def initialize
      @enable_cache = true
      @varnish_servers = []
      @default_ttl = 0
      @job_backend = :none
      @retries = 5
      @command_error_handler = nil
    end

    # Returns a hash of all configurable options
    def to_hash
      OPTIONS.inject({}) do |hash, option|
        hash.merge(option.to_sym => send(option))
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
posterous-lacquer-0.2.5 lib/lacquer/configuration.rb