Class: PactBroker::Diagnostic::Resources::Dependencies
- Inherits:
-
Webmachine::Resource
- Object
- Webmachine::Resource
- PactBroker::Diagnostic::Resources::Dependencies
- Includes:
- Logging
- Defined in:
- lib/pact_broker/diagnostic/resources/dependencies.rb
Constant Summary
Constants included from Logging
Logging::LOG_DIR, Logging::LOG_FILE_NAME
Instance Method Summary collapse
- #allowed_methods ⇒ Object
- #content_types_provided ⇒ Object
-
#initialize ⇒ Dependencies
constructor
A new instance of Dependencies.
- #to_json ⇒ Object
Methods included from Logging
included, #log_error, #logger, #logger=
Constructor Details
#initialize ⇒ Dependencies
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 |