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 ConfigurationService::Base response
This allows an OrchestrationProvider to decouple the Orchestrator from the implementation details of the service provider’s responses.
Instance Method Summary collapse
-
#allowed? ⇒ Boolean
Always true.
-
#data ⇒ Object
The configuration data dictionary of the response, or
nil
if not #found?. -
#failed? ⇒ Boolean
Always false.
-
#found? ⇒ Boolean
True if the
response
was notnil
. -
#initialize(response) ⇒ Success
constructor
Initialize a new Success with a response.
-
#metadata ⇒ Object
The metadata dictionary of the response, or
nil
if not #found?. -
#revision ⇒ Object
The revision from the response’s metadata, or
nil
if not #found?.
Constructor Details
#initialize(response) ⇒ Success
Initialize a new Success with a response
The response should be a Configuration object or nil
(because the ConfigurationService::Base API communicates not found as nil
).
29 30 31 |
# File 'lib/configuration_service/test/response.rb', line 29 def initialize(response) @response = response end |
Instance Method Details
#allowed? ⇒ Boolean
Always true
36 37 38 |
# File 'lib/configuration_service/test/response.rb', line 36 def allowed? true end |
#data ⇒ Object
The configuration data dictionary of the response, or nil
if not #found?
57 58 59 |
# File 'lib/configuration_service/test/response.rb', line 57 def data @response and @response.data end |
#failed? ⇒ Boolean
Always false
43 44 45 |
# File 'lib/configuration_service/test/response.rb', line 43 def failed? false end |
#found? ⇒ Boolean
True if the response
was not nil
50 51 52 |
# File 'lib/configuration_service/test/response.rb', line 50 def found? not @response.nil? end |
#metadata ⇒ Object
The metadata dictionary of the response, or nil
if not #found?
71 72 73 |
# File 'lib/configuration_service/test/response.rb', line 71 def @response and @response. end |
#revision ⇒ Object
The revision from the response’s metadata, or nil
if not #found?
64 65 66 |
# File 'lib/configuration_service/test/response.rb', line 64 def revision @response and @response.revision end |