Class: Runcible::Resources::EventNotifier
- Defined in:
- lib/runcible/resources/event_notifier.rb
Overview
Defined Under Namespace
Classes: EventTypes, NotifierTypes
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, #format_payload_json, #generate_log_message, #generate_payload, #get_response, #initialize, #lazy_config=, #log_debug, #log_exception, #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
45 46 47 |
# File 'lib/runcible/resources/event_notifier.rb', line 45 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
55 56 57 58 |
# File 'lib/runcible/resources/event_notifier.rb', line 55 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
64 65 66 |
# File 'lib/runcible/resources/event_notifier.rb', line 64 def delete(id) call(:delete, path(id)) end |
#list ⇒ RestClient::Response
List all Event Notifiers
72 73 74 |
# File 'lib/runcible/resources/event_notifier.rb', line 72 def list call(:get, path) end |