Class: Pagelime::Configuration
- Inherits:
-
Object
- Object
- Pagelime::Configuration
- Defined in:
- lib/pagelime/configuration.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
only allow getter access unless using configure block.
-
#cache_fetch_options ⇒ Object
Returns the value of attribute cache_fetch_options.
-
#generate_region_cache_key ⇒ Object
Returns the value of attribute generate_region_cache_key.
-
#logger ⇒ Object
only allow getter access unless using configure block.
-
#processor ⇒ Object
only allow getter access unless using configure block.
-
#static_shared_cache_key ⇒ Object
Returns the value of attribute static_shared_cache_key.
-
#storage ⇒ Object
only allow getter access unless using configure block.
-
#toggle_processing ⇒ Object
only allow getter access unless using configure block.
-
#url_path ⇒ Object
only allow getter access unless using configure block.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#initialize(defaults = {}, &block) ⇒ Configuration
constructor
pass in a configure block to write new values.
Constructor Details
#initialize(defaults = {}, &block) ⇒ Configuration
pass in a configure block to write new values
11 12 13 14 15 16 17 18 |
# File 'lib/pagelime/configuration.rb', line 11 def initialize(defaults = {}, &block) @logger = Logger.new(STDOUT) @url_path = "/pagelime" # on, per_request, off @toggle_processing = "on" configure(&block) end |
Instance Attribute Details
#cache ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def cache @cache end |
#cache_fetch_options ⇒ Object
Returns the value of attribute cache_fetch_options.
8 9 10 |
# File 'lib/pagelime/configuration.rb', line 8 def @cache_fetch_options end |
#generate_region_cache_key ⇒ Object
Returns the value of attribute generate_region_cache_key.
8 9 10 |
# File 'lib/pagelime/configuration.rb', line 8 def generate_region_cache_key @generate_region_cache_key end |
#logger ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def logger @logger end |
#processor ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def processor @processor end |
#static_shared_cache_key ⇒ Object
Returns the value of attribute static_shared_cache_key.
8 9 10 |
# File 'lib/pagelime/configuration.rb', line 8 def static_shared_cache_key @static_shared_cache_key end |
#storage ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def storage @storage end |
#toggle_processing ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def toggle_processing @toggle_processing end |
#url_path ⇒ Object
only allow getter access unless using configure block
7 8 9 |
# File 'lib/pagelime/configuration.rb', line 7 def url_path @url_path end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
20 21 22 23 24 |
# File 'lib/pagelime/configuration.rb', line 20 def configure(&block) yield(self) if block_given? self end |