Class: Clerk::Configuration
- Inherits:
-
Object
- Object
- Clerk::Configuration
- Defined in:
- lib/clerk/configuration.rb
Instance Attribute Summary collapse
-
#cache_store ⇒ Object
Returns the value of attribute cache_store.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#excluded_routes ⇒ Object
Returns the value of attribute excluded_routes.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#publishable_key ⇒ Object
Returns the value of attribute publishable_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #update(options) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/clerk/configuration.rb', line 15 def initialize @excluded_routes = [] @publishable_key = ENV['CLERK_PUBLISHABLE_KEY'] @secret_key = ENV['CLERK_SECRET_KEY'] # Default to Rails.cache or ActiveSupport::Cache::MemoryStore, if available, otherwise nil @cache_store = if defined?(::Rails) ::Rails.cache elsif defined?(::ActiveSupport::Cache::MemoryStore) ::ActiveSupport::Cache::MemoryStore.new end end |
Instance Attribute Details
#cache_store ⇒ Object
Returns the value of attribute cache_store.
7 8 9 |
# File 'lib/clerk/configuration.rb', line 7 def cache_store @cache_store end |
#debug ⇒ Object
Returns the value of attribute debug.
8 9 10 |
# File 'lib/clerk/configuration.rb', line 8 def debug @debug end |
#excluded_routes ⇒ Object
Returns the value of attribute excluded_routes.
9 10 11 |
# File 'lib/clerk/configuration.rb', line 9 def excluded_routes @excluded_routes end |
#logger ⇒ Object
Returns the value of attribute logger.
13 14 15 |
# File 'lib/clerk/configuration.rb', line 13 def logger @logger end |
#publishable_key ⇒ Object
Returns the value of attribute publishable_key.
10 11 12 |
# File 'lib/clerk/configuration.rb', line 10 def publishable_key @publishable_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
11 12 13 |
# File 'lib/clerk/configuration.rb', line 11 def secret_key @secret_key end |
Class Method Details
.default ⇒ Object
28 29 30 31 32 |
# File 'lib/clerk/configuration.rb', line 28 def self.default # rubocop:disable Style/ClassVars @@default ||= new # rubocop:enable Style/ClassVars end |
Instance Method Details
#update(options) ⇒ Object
34 35 36 37 38 |
# File 'lib/clerk/configuration.rb', line 34 def update() .each do |key, value| send(:"#{key}=", value) end end |