Class: Gush::Configuration
- Inherits:
-
Object
- Object
- Gush::Configuration
- Defined in:
- lib/gush/configuration.rb
Instance Attribute Summary collapse
-
#concurrency ⇒ Object
Returns the value of attribute concurrency.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#redis_prefix ⇒ Object
Returns the value of attribute redis_prefix.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#sidekiq_options ⇒ Object
Returns the value of attribute sidekiq_options.
-
#sidekiq_queue ⇒ Object
Returns the value of attribute sidekiq_queue.
Class Method Summary collapse
Instance Method Summary collapse
- #gushfile ⇒ Object
- #gushfile=(path) ⇒ Object
-
#initialize(hash = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/gush/configuration.rb', line 10 def initialize(hash = {}) self.concurrency = hash.fetch(:concurrency, 5) #self.namespace = hash.fetch(:namespace, 'gush') self.redis_url = hash.fetch(:redis_url, 'redis://localhost:6379') self.redis_prefix = hash.fetch(:redis_prefix, 'gush') self.sidekiq_queue = hash.fetch(:sidekiq_queue, 'gush') self.gushfile = hash.fetch(:gushfile, 'Gushfile.rb') self.environment = hash.fetch(:environment, 'development') # sidekiq self. = hash.fetch(:sidekiq_options, '') end |
Instance Attribute Details
#concurrency ⇒ Object
Returns the value of attribute concurrency.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def concurrency @concurrency end |
#environment ⇒ Object
Returns the value of attribute environment.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def environment @environment end |
#namespace ⇒ Object
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def namespace @namespace end |
#redis_prefix ⇒ Object
Returns the value of attribute redis_prefix.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def redis_prefix @redis_prefix end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def redis_url @redis_url end |
#sidekiq_options ⇒ Object
Returns the value of attribute sidekiq_options.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def @sidekiq_options end |
#sidekiq_queue ⇒ Object
Returns the value of attribute sidekiq_queue.
3 4 5 |
# File 'lib/gush/configuration.rb', line 3 def sidekiq_queue @sidekiq_queue end |
Class Method Details
Instance Method Details
#gushfile ⇒ Object
27 28 29 |
# File 'lib/gush/configuration.rb', line 27 def gushfile @gushfile.realpath end |
#gushfile=(path) ⇒ Object
23 24 25 |
# File 'lib/gush/configuration.rb', line 23 def gushfile=(path) @gushfile = Pathname(path) end |
#to_hash ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gush/configuration.rb', line 31 def to_hash { concurrency: concurrency, namespace: namespace, redis_url: redis_url, redis_prefix: redis_prefix, sidekiq_queue: sidekiq_queue, environment: environment } end |