Class: PactBroker::Diagnostic::Resources::Dependencies
- Inherits:
-
BaseResource
- Object
- Webmachine::Resource
- BaseResource
- PactBroker::Diagnostic::Resources::Dependencies
- Includes:
- Logging
- Defined in:
- lib/pact_broker/diagnostic/resources/dependencies.rb
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, #log_with_tag, #measure_info
Methods inherited from BaseResource
#base_url, #forbidden?, #is_authorized?
Methods included from Api::Resources::Authentication
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" => base_url + "/diagnostic/status/dependencies" } } }.to_json ok ? 200 : 500 end |