Class: ThreeScale::Core::Event

Inherits:
APIClient::Resource show all
Defined in:
lib/3scale/core/event.rb

Class Method Summary collapse

Methods inherited from APIClient::Resource

#initialize

Methods included from APIClient::Operations

included

Methods included from APIClient::Support

included

Methods included from APIClient::Attributes

#attributes, #dirty?, included, #update_attributes

Constructor Details

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

Class Method Details

.delete(id) ⇒ Object



11
12
13
# File 'lib/3scale/core/event.rb', line 11

def self.delete(id)
  api_delete({}, uri: event_uri(id))
end

.delete_upto(id) ⇒ Object



15
16
17
18
# File 'lib/3scale/core/event.rb', line 15

def self.delete_upto(id)
  results = api_do_delete({ upto_id: id }, prefix: '')
  results[:response_json][:num_events]
end

.load_allObject



6
7
8
9
# File 'lib/3scale/core/event.rb', line 6

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