Class: PactBroker::ApplicationContext
- Inherits:
-
Object
- Object
- PactBroker::ApplicationContext
- Defined in:
- lib/pact_broker/application_context.rb
Instance Attribute Summary collapse
-
#after_resource ⇒ Object
readonly
Returns the value of attribute after_resource.
-
#api_contract_configuration ⇒ Object
readonly
Returns the value of attribute api_contract_configuration.
-
#before_resource ⇒ Object
readonly
Returns the value of attribute before_resource.
-
#decorator_configuration ⇒ Object
readonly
Returns the value of attribute decorator_configuration.
-
#decorator_context_creator ⇒ Object
readonly
Returns the value of attribute decorator_context_creator.
-
#error_logger ⇒ Object
readonly
Returns the value of attribute error_logger.
-
#error_reporter ⇒ Object
readonly
Returns the value of attribute error_reporter.
-
#error_response_generator ⇒ Object
readonly
Returns the value of attribute error_response_generator.
-
#resource_authorizer ⇒ Object
readonly
Returns the value of attribute resource_authorizer.
-
#webhook_execution_configuration_creator ⇒ Object
readonly
Returns the value of attribute webhook_execution_configuration_creator.
Class Method Summary collapse
-
.default_application_context(overrides = {}) ⇒ Object
TODO pass in configuration.
Instance Method Summary collapse
-
#initialize(params) ⇒ ApplicationContext
constructor
A new instance of ApplicationContext.
Constructor Details
#initialize(params) ⇒ ApplicationContext
Returns a new instance of ApplicationContext.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/pact_broker/application_context.rb', line 14 def initialize(params) @decorator_configuration = params[:decorator_configuration] @api_contract_configuration = params[:api_contract_configuration] @decorator_context_creator = params[:decorator_context_creator] @webhook_execution_configuration_creator = params[:webhook_execution_configuration_creator] @resource_authorizer = params[:resource_authorizer] @before_resource = params[:before_resource] @after_resource = params[:after_resource] @error_logger = params[:error_logger] @error_reporter = params[:error_reporter] @error_response_generator = params[:error_response_generator] end |
Instance Attribute Details
#after_resource ⇒ Object (readonly)
Returns the value of attribute after_resource.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def after_resource @after_resource end |
#api_contract_configuration ⇒ Object (readonly)
Returns the value of attribute api_contract_configuration.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def api_contract_configuration @api_contract_configuration end |
#before_resource ⇒ Object (readonly)
Returns the value of attribute before_resource.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def before_resource @before_resource end |
#decorator_configuration ⇒ Object (readonly)
Returns the value of attribute decorator_configuration.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def decorator_configuration @decorator_configuration end |
#decorator_context_creator ⇒ Object (readonly)
Returns the value of attribute decorator_context_creator.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def decorator_context_creator @decorator_context_creator end |
#error_logger ⇒ Object (readonly)
Returns the value of attribute error_logger.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def error_logger @error_logger end |
#error_reporter ⇒ Object (readonly)
Returns the value of attribute error_reporter.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def error_reporter @error_reporter end |
#error_response_generator ⇒ Object (readonly)
Returns the value of attribute error_response_generator.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def error_response_generator @error_response_generator end |
#resource_authorizer ⇒ Object (readonly)
Returns the value of attribute resource_authorizer.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def @resource_authorizer end |
#webhook_execution_configuration_creator ⇒ Object (readonly)
Returns the value of attribute webhook_execution_configuration_creator.
3 4 5 |
# File 'lib/pact_broker/application_context.rb', line 3 def webhook_execution_configuration_creator @webhook_execution_configuration_creator end |
Class Method Details
.default_application_context(overrides = {}) ⇒ Object
TODO pass in configuration
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/pact_broker/application_context.rb', line 28 def self.default_application_context(overrides = {}) require "pact_broker/api/decorators/configuration" require "pact_broker/api/contracts/configuration" require "pact_broker/api/decorators/decorator_context_creator" require "pact_broker/webhooks/execution_configuration_creator" require "pact_broker/errors/error_logger" require "pact_broker/errors/error_reporter" require "pact_broker/api/resources/error_response_generator" params = { decorator_configuration: PactBroker::Api::Decorators::Configuration.default_configuration, api_contract_configuration: PactBroker::Api::Contracts::Configuration.default_configuration, decorator_context_creator: PactBroker::Api::Decorators::DecoratorContextCreator, webhook_execution_configuration_creator: PactBroker::Webhooks::ExecutionConfigurationCreator, error_logger: PactBroker::Errors::ErrorLogger, error_reporter: PactBroker::Errors::ErrorReporter.new(PactBroker.configuration.api_error_reporters), error_response_generator: PactBroker::Api::Resources::ErrorResponseGenerator, }.merge(overrides) ApplicationContext.new(params) end |