Sha256: 61891594ae579e2e12cd13b83fd4f6e9ff3445317c93cff7278978f4b23d0683

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

module Clearance
  class Configuration
    attr_accessor \
      :cookie_expiration,
      :httponly,
      :mailer_sender,
      :password_strategy,
      :redirect_url,
      :secure_cookie,
      :user_model

    def initialize
      @cookie_expiration = lambda { 1.year.from_now.utc }
      @httponly = false
      @mailer_sender = 'reply@example.com'
      @secure_cookie = false
      @redirect_url = '/'
    end

    def user_model
      @user_model || ::User
    end
  end

  class << self
    attr_accessor :configuration
  end

  def self.configure
    self.configuration ||= Configuration.new
    yield configuration
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clearance-1.0.1 lib/clearance/configuration.rb
clearance-1.0.0 lib/clearance/configuration.rb
clearance-1.0.0.rc8 lib/clearance/configuration.rb