Class: ConfigurationService::Test::Response::Success
- Inherits:
-
Object
- Object
- ConfigurationService::Test::Response::Success
- Defined in:
- lib/configuration_service/test/response.rb
Overview
Encapsulates a non-error configuration service response
This allows an OrchestrationProvider to decouple the Orchestrator from the semantics of the configuration service’s responses.
Instance Method Summary collapse
-
#allowed? ⇒ true
Whether the request was allowed.
-
#data ⇒ Hash?
The configuration data dictionary of the response.
-
#failed? ⇒ false
Whether the request was authorized but failed.
-
#found? ⇒ true, false
Whether the identified configuration was found.
-
#initialize(response) ⇒ Success
constructor
A new instance of Success.
-
#metadata ⇒ Hash?
The configuration metadata.
-
#revision ⇒ String?
The configuration metadata’s revision.
Constructor Details
#initialize(response) ⇒ Success
Returns a new instance of Success.
26 27 28 |
# File 'lib/configuration_service/test/response.rb', line 26 def initialize(response) @response = response end |
Instance Method Details
#allowed? ⇒ true
Whether the request was allowed
35 36 37 |
# File 'lib/configuration_service/test/response.rb', line 35 def allowed? true end |
#data ⇒ Hash?
The configuration data dictionary of the response
64 65 66 |
# File 'lib/configuration_service/test/response.rb', line 64 def data @response and @response.data end |
#failed? ⇒ false
Whether the request was authorized but failed
44 45 46 |
# File 'lib/configuration_service/test/response.rb', line 44 def failed? false end |
#found? ⇒ true, false
Whether the identified configuration was found
54 55 56 |
# File 'lib/configuration_service/test/response.rb', line 54 def found? not @response.nil? end |
#metadata ⇒ Hash?
The configuration metadata
84 85 86 |
# File 'lib/configuration_service/test/response.rb', line 84 def @response and @response. end |
#revision ⇒ String?
The configuration metadata’s revision
74 75 76 |
# File 'lib/configuration_service/test/response.rb', line 74 def revision @response and @response.["revision"] end |