Class: NewRelicApi::BaseResource

Inherits:
ActiveResource::Base
  • Object
show all
Includes:
ActiveResourceAssociations
Defined in:
lib/new_relic_api.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.headersObject



59
60
61
62
# File 'lib/new_relic_api.rb', line 59

def headers
  raise "api_key required" unless NewRelicApi.api_key
  {'x-api-key' => NewRelicApi.api_key}
end

.inherited(klass) ⇒ Object

:nodoc:



55
56
57
# File 'lib/new_relic_api.rb', line 55

def inherited(klass) #:nodoc:
  NewRelicApi.track_resource(klass)
end

.proxyObject



74
75
76
# File 'lib/new_relic_api.rb', line 74

def proxy
  NewRelicApi.proxy
end

.reset!Object



70
71
72
# File 'lib/new_relic_api.rb', line 70

def reset!
  self.site = self.site_url
end

.site_urlObject



64
65
66
67
68
# File 'lib/new_relic_api.rb', line 64

def site_url
  host = NewRelicApi.host || 'rpm.newrelic.com'
  port = NewRelicApi.port || 80
  "#{port == 443 ? 'https' : 'http'}://#{host}:#{port}"
end