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

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

Constructor Details

#initialize(response) ⇒ Success

Returns a new instance of Success.

Parameters:



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

Returns:

  • (true)

    always



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

def allowed?
  true
end

#dataHash?

The configuration data dictionary of the response

Returns:



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

Returns:

  • (false)

    always



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

Returns:

  • (true)

    if the response was not nil

  • (false)

    if the response was nil



54
55
56
# File 'lib/configuration_service/test/response.rb', line 54

def found?
  not @response.nil?
end

#metadataHash?

The configuration metadata

Returns:



84
85
86
# File 'lib/configuration_service/test/response.rb', line 84

def 
  @response and @response.
end

#revisionString?

The configuration metadata’s revision

Returns:



74
75
76
# File 'lib/configuration_service/test/response.rb', line 74

def revision
  @response and @response.["revision"]
end