Class: ConfigurationService::Test::Response::Success

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Boolean)


36
37
38
# File 'lib/configuration_service/test/response.rb', line 36

def allowed?
  true
end

#dataObject

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

Returns:

  • (Boolean)


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

Returns:

  • (Boolean)


50
51
52
# File 'lib/configuration_service/test/response.rb', line 50

def found?
  not @response.nil?
end

#metadataObject

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

#revisionObject

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