Class: Mailjet::Template_detailcontent

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/mailjet/resources/template_detailcontent.rb

Constant Summary

Constants included from Resource

Resource::DATA_URLS, Resource::NON_JSON_URLS, Resource::OPTIONS

Instance Attribute Summary

Attributes included from Resource

#attributes, #persisted

Class Method Summary collapse

Methods included from Resource

#delete, included, #initialize, #persisted?, #save, #save!, #update_attributes

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mailjet::Resource

Class Method Details

.find(id, options = {}) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/mailjet/resources/template_detailcontent.rb', line 10

def self.find(id, options = {})
  self.resource_path = create_action_resource_path(id)

  opts = define_options(options)
  response = connection(opts).get(default_headers)
  attributes = parse_api_json(response.body).first

  instanciate_from_api(attributes)
rescue Mailjet::CommunicationError => e
  if e.code == 404
    nil
  else
    raise e
  end
end