Module: SendgridToolkit::Common
- Included in:
- Bounces, InvalidEmails, SpamReports
- Defined in:
- lib/sendgrid_toolkit/common.rb
Instance Method Summary collapse
- #delete(options = {}) ⇒ Object
- #module_name ⇒ Object
- #retrieve(options = {}) ⇒ Object
- #retrieve_with_timestamps(options = {}) ⇒ Object
Instance Method Details
#delete(options = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/sendgrid_toolkit/common.rb', line 23 def delete( = {}) response = api_post(module_name, 'delete', ) if !response["message"].nil? raise EmailDoesNotExist if response['message'].include?('does not exist') end response end |
#module_name ⇒ Object
31 32 33 |
# File 'lib/sendgrid_toolkit/common.rb', line 31 def module_name self.class.to_s.split("::").last.downcase end |
#retrieve(options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/sendgrid_toolkit/common.rb', line 5 def retrieve( = {}) response = api_post(module_name, 'get', ) response end |
#retrieve_with_timestamps(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sendgrid_toolkit/common.rb', line 10 def ( = {}) .merge! :date => 1 response = retrieve if response.is_a? Array response.each do || end else response end response end |