Class: Sendgrid::Newsletter::Schedule

Inherits:
Base
  • Object
show all
Defined in:
lib/sendgrid-newsletter/schedule.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Sendgrid::Newsletter::Base

Instance Method Details

#add(options = {}) ⇒ Object

Raises:



6
7
8
9
10
11
# File 'lib/sendgrid-newsletter/schedule.rb', line 6

def add(options={})
  check_required_params options, [:name]
  response = self.class.post '/schedule/add.json', body: options
  raise APIError.new(response['error']) if response['error']
  response
end

#delete(options = {}) ⇒ Object

Raises:



13
14
15
16
17
18
# File 'lib/sendgrid-newsletter/schedule.rb', line 13

def delete(options={})
  check_required_params options, [:name]
  response = self.class.post '/schedule/delete.json', body: options
  raise APIError.new(response['error']) if response['error']
  response
end