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 Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
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.
28 29 30 |
# File 'lib/configuration_service/test/response.rb', line 28 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
22 23 24 |
# File 'lib/configuration_service/test/response.rb', line 22 def response @response end |
Instance Method Details
#allowed? ⇒ true
Whether the request was allowed
37 38 39 |
# File 'lib/configuration_service/test/response.rb', line 37 def allowed? true end |
#data ⇒ Hash?
The configuration data dictionary of the response
66 67 68 |
# File 'lib/configuration_service/test/response.rb', line 66 def data @response and @response.data end |
#failed? ⇒ false
Whether the request was authorized but failed
46 47 48 |
# File 'lib/configuration_service/test/response.rb', line 46 def failed? false end |
#found? ⇒ true, false
Whether the identified configuration was found
56 57 58 |
# File 'lib/configuration_service/test/response.rb', line 56 def found? not @response.nil? end |
#metadata ⇒ Hash?
The configuration metadata
86 87 88 |
# File 'lib/configuration_service/test/response.rb', line 86 def @response and @response. end |
#revision ⇒ String?
The configuration metadata’s revision
76 77 78 |
# File 'lib/configuration_service/test/response.rb', line 76 def revision @response and @response.["revision"] end |