Sha256: 58bd957bc73aa6b8f52e3de6014db1d19ef9af488a064249d24bdfd9b008dae8

Contents?: true

Size: 541 Bytes

Versions: 14

Compression:

Stored size: 541 Bytes

Contents

require 'rest-client'
require 'cgi'

module DashingContrib
  module Pingdom
    module Checks
      extend self

      def fetch(credentials, id)
        make_request(credentials, id)
      end

      private
      def make_request(credentials, id)
        request_url = "https://#{credentials.username}:#{credentials.password}@api.pingdom.com/api/2.0/checks/#{id}"
        response = RestClient.get(request_url, { 'App-Key' => credentials.api_key })
        MultiJson.load response.body, { symbolize_keys: true }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dashing-contrib-0.1.14 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.12 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.11 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.10 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.9 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.8 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.7 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.6 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.5 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.4 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.3 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.2 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.1 lib/dashing-contrib/bottles/pingdom/checks.rb
dashing-contrib-0.1.0 lib/dashing-contrib/bottles/pingdom/checks.rb