Class: Octobat::DocumentTemplate

Inherits:
APIResource show all
Extended by:
APIOperations::List
Includes:
APIOperations::Create, APIOperations::Update
Defined in:
lib/octobat/document_template.rb

Instance Attribute Summary

Attributes inherited from OctobatObject

#api_key, #parent_obj

Instance Method Summary collapse

Methods included from APIOperations::List

list, set_parent_resource

Methods included from APIOperations::Update

#save, #serialize_metadata, #serialize_params

Methods included from APIOperations::Create

included

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from OctobatObject

#[], #[]=, #_dump, _load, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #respond_to?, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Octobat::OctobatObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Octobat::OctobatObject

Instance Method Details

#activateObject



12
13
14
15
# File 'lib/octobat/document_template.rb', line 12

def activate
  response, api_key = Octobat.request(:patch, activate_url, @api_key)
  refresh_from(response, api_key)
end

#deleteObject



17
18
19
20
# File 'lib/octobat/document_template.rb', line 17

def delete
  response, api_key = Octobat.request(:delete, url, @api_key)
  refresh_from(response, api_key)
end

#duplicate(params = {}) ⇒ Object



7
8
9
10
# File 'lib/octobat/document_template.rb', line 7

def duplicate(params = {})
  response, api_key = Octobat.request(:post, duplicate_url, @api_key, params)
  refresh_from(response, api_key)
end

#preview(params = {}) ⇒ Object



22
23
24
25
# File 'lib/octobat/document_template.rb', line 22

def preview(params = {})
  response, api_key = Octobat.request(:get, preview_url, @api_key, params)
  refresh_from(response, api_key)
end