Class: NewRelicApi::BaseResource
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- NewRelicApi::BaseResource
- Includes:
- ActiveResourceAssociations
- Defined in:
- lib/new_relic_api.rb
Overview
:nodoc:
Direct Known Subclasses
Account, Account::AccountUsage, Account::AccountView, Application, Application::Agent, Deployment, Subscription, ThresholdValue, User
Class Method Summary collapse
- .headers ⇒ Object
-
.inherited(klass) ⇒ Object
:nodoc:.
- .proxy ⇒ Object
- .reset! ⇒ Object
- .site_url ⇒ Object
Class Method Details
.headers ⇒ Object
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 |
.proxy ⇒ Object
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_url ⇒ Object
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 |