Class: Runcible::Resources::EventNotifier
- Defined in:
- lib/runcible/resources/event_notifier.rb
Overview
Defined Under Namespace
Classes: EventTypes, NotifierTypes
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.path(id = nil) ⇒ String
Generates the API path for Event Notifiers.
Instance Method Summary collapse
-
#create(notifier_type_id, notifier_config, event_types) ⇒ RestClient::Response
Creates an Event Notification.
-
#delete(id) ⇒ RestClient::Response
Deletes an Event Notification.
-
#list ⇒ RestClient::Response
List all Event Notifiers.
Methods inherited from Base
#add_http_auth_header, #add_oauth_header, #call, #combine_get_params, #config, #exception_to_log, #format_payload_json, #generate_payload, #get_response, #initialize, #lazy_config=, #log_debug, #log_exception, #log_info, #logger, #path, #process_response, #required_params
Constructor Details
This class inherits a constructor from Runcible::Base
Class Method Details
.path(id = nil) ⇒ String
Generates the API path for Event Notifiers
20 21 22 |
# File 'lib/runcible/resources/event_notifier.rb', line 20 def self.path(id = nil) id.nil? ? 'events/' : "events/#{id}/" end |
Instance Method Details
#create(notifier_type_id, notifier_config, event_types) ⇒ RestClient::Response
Creates an Event Notification
30 31 32 33 |
# File 'lib/runcible/resources/event_notifier.rb', line 30 def create(notifier_type_id, notifier_config, event_types) required = required_params(binding.send(:local_variables), binding) call(:post, path, :payload => {:required => required}) end |
#delete(id) ⇒ RestClient::Response
Deletes an Event Notification
39 40 41 |
# File 'lib/runcible/resources/event_notifier.rb', line 39 def delete(id) call(:delete, path(id)) end |
#list ⇒ RestClient::Response
List all Event Notifiers
47 48 49 |
# File 'lib/runcible/resources/event_notifier.rb', line 47 def list call(:get, path) end |