Class: PactBroker::Diagnostic::Resources::Heartbeat

Inherits:
BaseResource
  • Object
show all
Defined in:
lib/pact_broker/diagnostic/resources/heartbeat.rb

Instance Method Summary collapse

Methods inherited from BaseResource

#base_url, #forbidden?, #is_authorized?

Methods included from Api::Resources::Authentication

#authenticated?

Instance Method Details

#allowed_methodsObject



7
8
9
# File 'lib/pact_broker/diagnostic/resources/heartbeat.rb', line 7

def allowed_methods
  ["GET"]
end

#content_types_providedObject



11
12
13
# File 'lib/pact_broker/diagnostic/resources/heartbeat.rb', line 11

def content_types_provided
  [["application/hal+json", :to_json]]
end

#to_jsonObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/pact_broker/diagnostic/resources/heartbeat.rb', line 15

def to_json
  {
    "ok" => true,
    "_links" => {
      "self" => {
        "href" => base_url + "/diagnostic/status/heartbeat"
      }
    }
  }.to_json
end