Class: Jackhammer::Configuration
- Inherits:
-
Object
- Object
- Jackhammer::Configuration
- Defined in:
- lib/jackhammer/configuration.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
Returns the value of attribute app_name.
-
#client_middleware ⇒ Object
Returns the value of attribute client_middleware.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
-
#connection_url ⇒ Object
Returns the value of attribute connection_url.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#exception_adapter ⇒ Object
Returns the value of attribute exception_adapter.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#publish_options ⇒ Object
Returns the value of attribute publish_options.
-
#server ⇒ Object
Returns the value of attribute server.
-
#server_middleware ⇒ Object
Returns the value of attribute server_middleware.
-
#yaml_config ⇒ Object
Returns the value of attribute yaml_config.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #yaml ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/jackhammer/configuration.rb', line 17 def initialize @connection_options = {} @connection_url = ENV['RABBITMQ_URL'] @environment = ENV['RACK_ENV'] || :development @exception_adapter = proc { |e| fail e } @logger = Logger.new IO::NULL @publish_options = { mandatory: true, persistent: true } @yaml_config = './config/jackhammer.yml' @client_middleware = MiddlewareCollection.new @server_middleware = MiddlewareCollection.new end |
Instance Attribute Details
#app_name ⇒ Object
Returns the value of attribute app_name.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def app_name @app_name end |
#client_middleware ⇒ Object
Returns the value of attribute client_middleware.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def client_middleware @client_middleware end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def @connection_options end |
#connection_url ⇒ Object
Returns the value of attribute connection_url.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def connection_url @connection_url end |
#environment ⇒ Object
Returns the value of attribute environment.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def environment @environment end |
#exception_adapter ⇒ Object
Returns the value of attribute exception_adapter.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def exception_adapter @exception_adapter end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def logger @logger end |
#publish_options ⇒ Object
Returns the value of attribute publish_options.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def @publish_options end |
#server ⇒ Object
Returns the value of attribute server.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def server @server end |
#server_middleware ⇒ Object
Returns the value of attribute server_middleware.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def server_middleware @server_middleware end |
#yaml_config ⇒ Object
Returns the value of attribute yaml_config.
3 4 5 |
# File 'lib/jackhammer/configuration.rb', line 3 def yaml_config @yaml_config end |
Class Method Details
.instance ⇒ Object
29 30 31 |
# File 'lib/jackhammer/configuration.rb', line 29 def self.instance @instance ||= new end |
Instance Method Details
#yaml ⇒ Object
33 34 35 36 |
# File 'lib/jackhammer/configuration.rb', line 33 def yaml environment = Jackhammer.configuration.environment.to_s YAML.load_file(Jackhammer.configuration.yaml_config)[environment] end |