Class: ThreeScale::Core::AlertLimit

Inherits:
ThreeScale::Core::APIClient::Resource show all
Defined in:
lib/3scale/core/alert_limit.rb

Class Method Summary collapse

Methods inherited from ThreeScale::Core::APIClient::Resource

#initialize

Methods included from ThreeScale::Core::APIClient::Operations

included

Methods included from ThreeScale::Core::APIClient::Support

included

Methods included from ThreeScale::Core::APIClient::Attributes

#attributes, #dirty?, included, #update_attributes

Constructor Details

This class inherits a constructor from ThreeScale::Core::APIClient::Resource

Class Method Details

.delete(service_id, value) ⇒ Object



27
28
29
# File 'lib/3scale/core/alert_limit.rb', line 27

def self.delete(service_id, value)
  api_delete({}, uri: alert_limit_uri(service_id, value))
end

.load_all(service_id) ⇒ Object



8
9
10
11
# File 'lib/3scale/core/alert_limit.rb', line 8

def self.load_all(service_id)
  results = api_do_get({}, rprefix: :alert_limits, uri: alert_limit_uri(service_id))
  results[:attributes].map { |attrs| new(attrs) }
end

.save(service_id, value) ⇒ Object



23
24
25
# File 'lib/3scale/core/alert_limit.rb', line 23

def self.save(service_id, value)
  api_save({value: value}, uri: alert_limit_uri(service_id), prefix: :alert_limit)
end