Class: SendGrid4r::CLI::Templates::Template

Inherits:
SgThor
  • Object
show all
Defined in:
lib/sendgrid4r/cli/templates/template.rb

Overview

SendGrid Web API v3 Templates

Instance Method Summary collapse

Methods inherited from SgThor

#initialize

Constructor Details

This class inherits a constructor from SendGrid4r::CLI::SgThor

Instance Method Details

#createObject



9
10
11
12
13
# File 'lib/sendgrid4r/cli/templates/template.rb', line 9

def create
  puts @client.post_template(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#deleteObject



41
42
43
44
45
# File 'lib/sendgrid4r/cli/templates/template.rb', line 41

def delete
  puts @client.delete_template(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#getObject



24
25
26
27
28
# File 'lib/sendgrid4r/cli/templates/template.rb', line 24

def get
  puts @client.get_template(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#listObject



16
17
18
19
20
# File 'lib/sendgrid4r/cli/templates/template.rb', line 16

def list
  puts @client.get_templates
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end

#updateObject



33
34
35
36
37
# File 'lib/sendgrid4r/cli/templates/template.rb', line 33

def update
  puts @client.patch_template(parameterise(options))
rescue RestClient::ExceptionWithResponse => e
  puts e.inspect
end