Class: Pagelime::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/pagelime/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cacheObject

only allow getter access unless using configure block



7
8
9
# File 'lib/pagelime/configuration.rb', line 7

def cache
  @cache
end

#cache_fetch_optionsObject

Returns the value of attribute cache_fetch_options.



8
9
10
# File 'lib/pagelime/configuration.rb', line 8

def cache_fetch_options
  @cache_fetch_options
end

#generate_region_cache_keyObject

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

#loggerObject

only allow getter access unless using configure block



7
8
9
# File 'lib/pagelime/configuration.rb', line 7

def logger
  @logger
end

#processorObject

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_keyObject

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

#storageObject

only allow getter access unless using configure block



7
8
9
# File 'lib/pagelime/configuration.rb', line 7

def storage
  @storage
end

#toggle_processingObject

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_pathObject

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

Yields:

  • (_self)

Yield Parameters:



20
21
22
23
24
# File 'lib/pagelime/configuration.rb', line 20

def configure(&block)
  yield(self) if block_given?
  
  self
end