Class: Serve::Rails::Configuration
- Inherits:
-
Object
- Object
- Serve::Rails::Configuration
- Defined in:
- lib/serve/rails/configuration.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#mounts ⇒ Object
readonly
Returns the value of attribute mounts.
-
#view_helpers ⇒ Object
readonly
Returns the value of attribute view_helpers.
Instance Method Summary collapse
- #define_find_cache(&block) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #mount(route, root_path) {|m| ... } ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/serve/rails/configuration.rb', line 6 def initialize Serve::ResponseCache.defaults.update( :logger => ActionController::Base.logger, :perform_caching => ActionController::Base.perform_caching ) @mounts = [] define_find_cache do |request| @default_cache ||= Serve::ResponseCache.new( :directory => File.join(::Rails.root, 'tmp', 'serve_cache') ) end end |
Instance Attribute Details
#mounts ⇒ Object (readonly)
Returns the value of attribute mounts.
4 5 6 |
# File 'lib/serve/rails/configuration.rb', line 4 def mounts @mounts end |
#view_helpers ⇒ Object (readonly)
Returns the value of attribute view_helpers.
4 5 6 |
# File 'lib/serve/rails/configuration.rb', line 4 def view_helpers @view_helpers end |
Instance Method Details
#define_find_cache(&block) ⇒ Object
21 22 23 24 25 |
# File 'lib/serve/rails/configuration.rb', line 21 def define_find_cache(&block) .module_eval do define_method :find_cache, &block end end |