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
# File 'lib/pagelime/configuration.rb', line 11

def initialize(defaults = {}, &block)
  @logger = Logger.new(STDOUT)
  
  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

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



17
18
19
20
21
# File 'lib/pagelime/configuration.rb', line 17

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