Sha256: 7ac757a0fdea7fac322c861e67be90c25989a46e8b382396fd13eb4a83713065

Contents?: true

Size: 473 Bytes

Versions: 5

Compression:

Stored size: 473 Bytes

Contents

module Clearance
  class Configuration
    attr_accessor :cookie_expiration, :mailer_sender, :password_strategy, :user_model

    def initialize
      @cookie_expiration = lambda { 1.year.from_now.utc }
      @mailer_sender = 'reply@example.com'
    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

5 entries across 5 versions & 1 rubygems

Version Path
clearance-1.0.0.rc6 lib/clearance/configuration.rb
clearance-1.0.0.rc4 lib/clearance/configuration.rb
clearance-1.0.0.rc3 lib/clearance/configuration.rb
clearance-1.0.0.rc2 lib/clearance/configuration.rb
clearance-1.0.0.rc1 lib/clearance/configuration.rb