Class: QPush::Server::Config
- Inherits:
-
Base::Config
- Object
- Base::Config
- QPush::Server::Config
- Includes:
- ObjectValidator::Validate
- Defined in:
- lib/qpush/server/config.rb
Constant Summary collapse
- SERVER_DEFAULTS =
{ database_url: ENV['DATABASE_URL'], database_pool: 10, jobs_path: '/jobs', workers: [WorkerConfig.new] }.freeze
Constants inherited from Base::Config
Instance Attribute Summary collapse
-
#database_pool ⇒ Object
Returns the value of attribute database_pool.
-
#database_url ⇒ Object
Returns the value of attribute database_url.
-
#jobs_path ⇒ Object
Returns the value of attribute jobs_path.
-
#workers ⇒ Object
Returns the value of attribute workers.
Attributes inherited from Base::Config
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate! ⇒ Object
Methods inherited from Base::Config
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
25 26 27 28 |
# File 'lib/qpush/server/config.rb', line 25 def initialize super SERVER_DEFAULTS.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#database_pool ⇒ Object
Returns the value of attribute database_pool.
23 24 25 |
# File 'lib/qpush/server/config.rb', line 23 def database_pool @database_pool end |
#database_url ⇒ Object
Returns the value of attribute database_url.
23 24 25 |
# File 'lib/qpush/server/config.rb', line 23 def database_url @database_url end |
#jobs_path ⇒ Object
Returns the value of attribute jobs_path.
23 24 25 |
# File 'lib/qpush/server/config.rb', line 23 def jobs_path @jobs_path end |
#workers ⇒ Object
Returns the value of attribute workers.
23 24 25 |
# File 'lib/qpush/server/config.rb', line 23 def workers @workers end |
Instance Method Details
#validate! ⇒ Object
30 31 32 33 |
# File 'lib/qpush/server/config.rb', line 30 def validate! return if valid? fail ServerError, errors..join(' ') end |