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_url ⇒ Object
Returns the value of attribute redis_url.
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.
9 10 11 12 13 14 15 |
# File 'lib/gush/configuration.rb', line 9 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.gushfile = hash.fetch(:gushfile, 'Gushfile.rb') self.environment = hash.fetch(:environment, 'development') 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_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 |
Class Method Details
Instance Method Details
#gushfile ⇒ Object
21 22 23 |
# File 'lib/gush/configuration.rb', line 21 def gushfile @gushfile.realpath end |
#gushfile=(path) ⇒ Object
17 18 19 |
# File 'lib/gush/configuration.rb', line 17 def gushfile=(path) @gushfile = Pathname(path) end |
#to_hash ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/gush/configuration.rb', line 25 def to_hash { concurrency: concurrency, namespace: namespace, redis_url: redis_url, environment: environment } end |