Class: Greencache::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
# File 'lib/greencache/configuration.rb', line 12

def initialize
  @cache_time = 600
  @encrypt = false
  @secret = nil
  @skip_cache = false
  @silent = false
  @logger = nil
  @log_prefix = "greencache"
end

Instance Attribute Details

#cache_timeObject

Returns the value of attribute cache_time.



5
6
7
# File 'lib/greencache/configuration.rb', line 5

def cache_time
  @cache_time
end

#encryptObject

Returns the value of attribute encrypt.



6
7
8
# File 'lib/greencache/configuration.rb', line 6

def encrypt
  @encrypt
end

#log_prefixObject

Returns the value of attribute log_prefix.



10
11
12
# File 'lib/greencache/configuration.rb', line 10

def log_prefix
  @log_prefix
end

#loggerObject

Returns the value of attribute logger.



9
10
11
# File 'lib/greencache/configuration.rb', line 9

def logger
  @logger
end

#redisObject

Returns the value of attribute redis.



3
4
5
# File 'lib/greencache/configuration.rb', line 3

def redis
  @redis
end

#secretObject

Returns the value of attribute secret.



4
5
6
# File 'lib/greencache/configuration.rb', line 4

def secret
  @secret
end

#silentObject

Returns the value of attribute silent.



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

def silent
  @silent
end

#skip_cacheObject

Returns the value of attribute skip_cache.



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

def skip_cache
  @skip_cache
end

Instance Method Details

#to_hashObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/greencache/configuration.rb', line 22

def to_hash
  {
    cache_time: cache_time,
    encrypt:    encrypt,
    secret:     secret,
    skip_cache: skip_cache,
    silent:     silent,
    logger:     logger,
    log_prefix: log_prefix,
    redis:      redis
  }
end