Class: PactBroker::Diagnostic::Resources::Dependencies
- Inherits:
-
BaseResource
- Object
- Webmachine::Resource
- BaseResource
- PactBroker::Diagnostic::Resources::Dependencies
show all
- Includes:
- Logging
- Defined in:
- lib/pact_broker/diagnostic/resources/dependencies.rb
Instance Method Summary
collapse
Methods included from Logging
included, #log_error
#finish_request, #forbidden?, #is_authorized?
#authenticated?
Constructor Details
Returns a new instance of Dependencies.
12
13
14
|
# File 'lib/pact_broker/diagnostic/resources/dependencies.rb', line 12
def initialize
@return_status = 200
end
|
Instance Method Details
#allowed_methods ⇒ Object
16
17
18
|
# File 'lib/pact_broker/diagnostic/resources/dependencies.rb', line 16
def allowed_methods
["GET"]
end
|
#content_types_provided ⇒ Object
20
21
22
|
# File 'lib/pact_broker/diagnostic/resources/dependencies.rb', line 20
def content_types_provided
[["application/hal+json", :to_json]]
end
|
#to_json ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/pact_broker/diagnostic/resources/dependencies.rb', line 24
def to_json
ok, report = database_connectivity_status
response.body = {
"database" => report,
"_links" => {
"self" => {
"href" => request.uri.to_s
}
}
}.to_json
ok ? 200 : 500
end
|