Class: Locomotive::Configuration
- Inherits:
-
Object
- Object
- Locomotive::Configuration
show all
- Defined in:
- lib/locomotive/configuration.rb
Constant Summary
collapse
- @@default_locales =
%w{en de fr bg cs da el es ca fa-IR fi-FI it ja-JP lt nl pl-PL pt pt-BR ru sv sv-FI uk zh-CN}
- @@site_locales =
@@default_locales + %w{hr et nb sk sl sr}
- @@defaults =
{
name: 'Locomotive',
host: nil,
reserved_site_handles: %w(sites my_account password sign_in sign_out),
reserved_slugs: %w{stylesheets javascripts assets admin locomotive images api pages edit},
reserved_domains: [],
locales: @@default_locales,
site_locales: @@site_locales,
cookie_key: '_locomotive_session',
enable_logs: false,
enable_admin_ssl: false,
delayed_job: false,
default_locale: :en,
mailer_sender: '[email protected]',
unsafe_token_authentication: false,
enable_registration: true,
ui: {
per_page: 10
},
rack_cache: {
verbose: true,
metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body")
},
devise_modules: [:registerable, :rememberable, :database_authenticatable, :recoverable, :trackable, :validatable, :encryptable, { encryptor: :sha1 }],
steam_image_resizer_secret: 'please change it'
}
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of Configuration.
38
39
40
|
# File 'lib/locomotive/configuration.rb', line 38
def initialize
@@settings = self.class.get_from_hash(@@defaults)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
46
47
48
|
# File 'lib/locomotive/configuration.rb', line 46
def method_missing(name, *args, &block)
self.settings.send(name, *args, &block)
end
|
Class Method Details
.settings ⇒ Object
42
43
44
|
# File 'lib/locomotive/configuration.rb', line 42
def self.settings
@@settings
end
|
Instance Method Details
#respond_to?(name, include_all = false) ⇒ Boolean
50
51
52
|
# File 'lib/locomotive/configuration.rb', line 50
def respond_to?(name, include_all = false)
self.settings.keys.include?(name.to_sym) || super
end
|