Class: BucketMaker::Configuration
- Inherits:
-
Object
- Object
- BucketMaker::Configuration
- Defined in:
- lib/bucket_maker/configuration.rb
Instance Attribute Summary collapse
-
#buckets_config_file ⇒ Object
Returns the value of attribute buckets_config_file.
-
#buckets_configuration ⇒ Object
readonly
Returns the value of attribute buckets_configuration.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#lazy_load ⇒ Object
Returns the value of attribute lazy_load.
-
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
-
#redis_expiration_time ⇒ Object
Returns the value of attribute redis_expiration_time.
-
#redis_options ⇒ Object
Returns the value of attribute redis_options.
Instance Method Summary collapse
- #configured? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_routes? ⇒ Boolean
- #reconfigure! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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 = { 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_file ⇒ Object
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_configuration ⇒ Object (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 |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
13 14 15 |
# File 'lib/bucket_maker/configuration.rb', line 13 def connection @connection end |
#lazy_load ⇒ Object
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_prefix ⇒ Object
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_time ⇒ Object
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_options ⇒ Object
Returns the value of attribute redis_options.
7 8 9 |
# File 'lib/bucket_maker/configuration.rb', line 7 def end |
Instance Method Details
#configured? ⇒ Boolean
40 41 42 |
# File 'lib/bucket_maker/configuration.rb', line 40 def configured? @buckets_configuration && @buckets_configuration.configured? end |
#load_routes? ⇒ 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 |