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

#finish_request, #forbidden?, #initialize, #is_authorized?

Methods included from Api::Resources::Authentication

#authenticated?

Constructor Details

This class inherits a constructor from PactBroker::Diagnostic::Resources::BaseResource

Instance Method Details

#allowed_methodsObject



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

def allowed_methods
  ["GET"]
end

#content_types_providedObject



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

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

#to_jsonObject



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

def to_json
  @@json ||= {
    "ok" => true,
    "_links" => {
      "self" => {
        "href" => request.uri.to_s
      }
    }
  }.to_json
end