Sha256: a1d900e42c91c4fb54856775e120513787c38fb9de7ea335987bcc2ebadd12d2

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 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

    def initialize
      @enable_cache = true
      @varnish_servers = []
      @default_ttl = 1.week
    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
lacquer-0.1.0 lib/lacquer/configuration.rb