Class: CachetSubscribers

Inherits:
CachetClient show all
Defined in:
lib/cachet.rb

Constant Summary

Constants inherited from CachetClient

CachetClient::INCIDENT_FIXED, CachetClient::INCIDENT_IDENTIFIED, CachetClient::INCIDENT_INVESTIGATING, CachetClient::INCIDENT_SCHEDULED, CachetClient::INCIDENT_WATCHING, CachetClient::STATUS_MAJOR_OUTAGE, CachetClient::STATUS_OPERATIONAL, CachetClient::STATUS_PARTIAL_OUTAGE, CachetClient::STATUS_PERFORMANCE_ISSUES, CachetClient::VERSION

Instance Method Summary collapse

Methods inherited from CachetClient

#initialize, #ping, #request

Constructor Details

This class inherits a constructor from CachetClient

Instance Method Details

#create(options) ⇒ Object

Create Subscriber.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :email (string)

    *Required* Email address to subscribe

  • :verify (int)

    Whether to send verification email 0/1

Returns:

  • object


381
382
383
384
385
# File 'lib/cachet.rb', line 381

def create(options)
  request method:  :post,
          url:     @base_url + 'subscribers',
          payload: options
end

#delete(options) ⇒ Object

Delete a Subscriber.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :id (string)

    ID of the subscriber to delete

Returns:

  • object


393
394
395
396
# File 'lib/cachet.rb', line 393

def delete(options)
  request method:  :delete,
          url:     @base_url + 'subscribers/' + options['id']
end

#listObject

List all Subscribers.

Returns:

  • object


369
370
371
372
# File 'lib/cachet.rb', line 369

def list
  request method:  :get,
          url:     @base_url + 'subscribers'
end