Class: BucketMaker::Configuration
- Inherits:
-
Object
- Object
- BucketMaker::Configuration
- Defined in:
- lib/bucket_maker/configuration.rb
Overview
Configuration Holder for the BucketMaker
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
Check if the configuration is done.
-
#initialize ⇒ Configuration
constructor
Initializer Sets up the default variable values.
-
#load_routes? ⇒ Boolean
Check if its ok to load routes.
-
#reconfigure! ⇒ Object
Reconfigure the Configuration.
Constructor Details
#initialize ⇒ Configuration
Initializer Sets up the default variable values
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/bucket_maker/configuration.rb', line 21 def initialize # For Redis @redis_options = { host: 'localhost', port: 6379, db: 1 } @redis_expiration_time = 12.months # For paths # If nil, the routes wont be loaded @path_prefix = '2bOrNot2B/' # Configuration for the buckets # @buckets_config_file = nil @buckets_configuration = nil # Lazy Load is used to group only if in_bucket? is called # if false, then the group is done at creation time of the objec as well # @lazy_load = true end |
Instance Attribute Details
#buckets_config_file ⇒ Object
Returns the value of attribute buckets_config_file.
9 10 11 |
# File 'lib/bucket_maker/configuration.rb', line 9 def buckets_config_file @buckets_config_file end |
#buckets_configuration ⇒ Object (readonly)
Returns the value of attribute buckets_configuration.
15 16 17 |
# File 'lib/bucket_maker/configuration.rb', line 15 def buckets_configuration @buckets_configuration end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
15 16 17 |
# File 'lib/bucket_maker/configuration.rb', line 15 def connection @connection end |
#lazy_load ⇒ Object
Returns the value of attribute lazy_load.
9 10 11 |
# File 'lib/bucket_maker/configuration.rb', line 9 def lazy_load @lazy_load end |
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
9 10 11 |
# File 'lib/bucket_maker/configuration.rb', line 9 def path_prefix @path_prefix end |
#redis_expiration_time ⇒ Object
Returns the value of attribute redis_expiration_time.
9 10 11 |
# File 'lib/bucket_maker/configuration.rb', line 9 def redis_expiration_time @redis_expiration_time end |
#redis_options ⇒ Object
Returns the value of attribute redis_options.
9 10 11 |
# File 'lib/bucket_maker/configuration.rb', line 9 def @redis_options end |
Instance Method Details
#configured? ⇒ Boolean
Check if the configuration is done
57 58 59 |
# File 'lib/bucket_maker/configuration.rb', line 57 def configured? @buckets_configuration && @buckets_configuration.configured? end |
#load_routes? ⇒ Boolean
Check if its ok to load routes
65 66 67 |
# File 'lib/bucket_maker/configuration.rb', line 65 def load_routes? @path_prefix != nil end |
#reconfigure! ⇒ Object
Reconfigure the Configuration
47 48 49 50 51 52 |
# File 'lib/bucket_maker/configuration.rb', line 47 def reconfigure! if @buckets_config_file @buckets_configuration = BucketMaker::SeriesMaker.instance @buckets_configuration.make!(@buckets_config_file) end end |