Module: NRRC::Routes::Helpers
- Included in:
- Application_Specific_Extras, Applications, Browser_Applications, Components, Key_Transactions, Labels, Mobile_applications, Notification_Channels, Plugins, Servers, Users
- Defined in:
- lib/new_relic_rest_client/route_helpers.rb
Instance Method Summary collapse
- #create_action(with, params = {}) ⇒ Object
- #delete_action(with, params = {}) ⇒ Object
- #get_action(with, params = {}) ⇒ Object
- #put_action(with, params = {}) ⇒ Object
- #url(id) ⇒ Object
Instance Method Details
#create_action(with, params = {}) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/new_relic_rest_client/route_helpers.rb', line 49 def create_action with,params={} action = deep_copy({ method: :post, headers: { :"X-Api-Key" => Routes.api_key, content_type: :json, } }).update(with) action[:headers].update(params: params) make_request(action) end |
#delete_action(with, params = {}) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/new_relic_rest_client/route_helpers.rb', line 38 def delete_action with,params={} action = deep_copy({ method: :delete, headers: { :"X-Api-Key" => Routes.api_key } }).update(with) action[:headers].update(params: params) make_request(action) end |
#get_action(with, params = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/new_relic_rest_client/route_helpers.rb', line 15 def get_action with,params={} action = deep_copy({ method: :get, headers: { :"X-Api-Key" => Routes.api_key } }).update(with) action[:headers].update(params: params) make_request(action) end |
#put_action(with, params = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/new_relic_rest_client/route_helpers.rb', line 26 def put_action with,params={} action = deep_copy({ method: :put, headers: { :"X-Api-Key" => Routes.api_key, content_type: :json, } }).update(with) action[:headers].update(params: params) make_request(action) end |
#url(id) ⇒ Object
11 12 13 |
# File 'lib/new_relic_rest_client/route_helpers.rb', line 11 def url id "#{@url_base}/%s" % [id] end |