Class: BucketMaker::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bucket_maker/configuration.rb', line 16

def initialize
  @redis_options = {
    host:    'localhost',
    port:    6379,
    db:      1
  }

  @redis_expiration_time = 12.months

  @path_prefix = '2bOrNot2B/'

  @buckets_config_file = nil
  @buckets_configuration = nil

  @lazy_load = true
end

Instance Attribute Details

#buckets_config_fileObject

Returns the value of attribute buckets_config_file.



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

def buckets_config_file
  @buckets_config_file
end

#buckets_configurationObject (readonly)

Returns the value of attribute buckets_configuration.



13
14
15
# File 'lib/bucket_maker/configuration.rb', line 13

def buckets_configuration
  @buckets_configuration
end

#connectionObject (readonly)

Returns the value of attribute connection.



13
14
15
# File 'lib/bucket_maker/configuration.rb', line 13

def connection
  @connection
end

#lazy_loadObject

Returns the value of attribute lazy_load.



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

def lazy_load
  @lazy_load
end

#path_prefixObject

Returns the value of attribute path_prefix.



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

def path_prefix
  @path_prefix
end

#redis_expiration_timeObject

Returns the value of attribute redis_expiration_time.



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

def redis_expiration_time
  @redis_expiration_time
end

#redis_optionsObject

Returns the value of attribute redis_options.



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

def redis_options
  @redis_options
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/bucket_maker/configuration.rb', line 40

def configured?
  @buckets_configuration && @buckets_configuration.configured?
end

#load_routes?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/bucket_maker/configuration.rb', line 44

def load_routes?
  @path_prefix != nil
end

#reconfigure!Object



33
34
35
36
37
38
# File 'lib/bucket_maker/configuration.rb', line 33

def reconfigure!
  if @buckets_config_file
    @buckets_configuration = BucketMaker::SeriesMaker.instance
    @buckets_configuration.make!(@buckets_config_file)
  end
end