Class: Iterable::Templates

Inherits:
ApiResource show all
Defined in:
lib/iterable/templates.rb

Overview

Interact with /templates API endpoints

Examples:

Creating templates endpoint object

# With default config
templates = Iterable::Templates.new
templates.all

# With custom config
conf = Iterable::Config.new(token: 'new-token')
templates = Iterable::Templates.new(config)

Constant Summary collapse

TYPES =

Template types

[
  BASE_TYPE      = 'Base'.freeze,
  BLAST_TYPE     = 'Blast'.freeze,
  TRIGGERED_TYPE = 'Triggered'.freeze,
  WORKFLOW_TYPE  = 'Workflow'.freeze
].freeze

Instance Attribute Summary

Attributes inherited from ApiResource

#conf

Instance Method Summary collapse

Methods inherited from ApiResource

#default_config, default_config, #initialize

Constructor Details

This class inherits a constructor from Iterable::ApiResource

Instance Method Details

#all(params = {}) ⇒ Object



39
40
41
# File 'lib/iterable/templates.rb', line 39

def all(params = {})
  Iterable.request(conf, '/templates', params).get
end

#for_client_template_id(client_template_id) ⇒ Object



56
57
58
59
# File 'lib/iterable/templates.rb', line 56

def for_client_template_id(client_template_id)
  params = { clientTemplateId: client_template_id }
  Iterable.request(conf, '/templates/getByClientTemplateId', params).get
end