Class: EmailDirect::CreativeFolder

Inherits:
Object
  • Object
show all
Defined in:
lib/emaildirect/creative_folder.rb

Overview

Represents a creative folder and associated functionality

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(folder_id) ⇒ CreativeFolder

Returns a new instance of CreativeFolder.



23
24
25
# File 'lib/emaildirect/creative_folder.rb', line 23

def initialize(folder_id)
  @folder_id = folder_id
end

Instance Attribute Details

#folder_idObject (readonly)

Returns the value of attribute folder_id.



21
22
23
# File 'lib/emaildirect/creative_folder.rb', line 21

def folder_id
  @folder_id
end

Class Method Details

.all(options = {}) ⇒ Object



8
9
10
11
# File 'lib/emaildirect/creative_folder.rb', line 8

def all(options = {})
  response = EmailDirect.get '/Creatives/Folders', :query => options
  Hashie::Mash.new(response)
end

.create(name, parent_id = nil) ⇒ Object



13
14
15
16
17
18
# File 'lib/emaildirect/creative_folder.rb', line 13

def create(name, parent_id = nil)
  uri = '/Creatives/Folders'
  uri << "/#{parent_id}" if parent_id
  response = EmailDirect.post uri, :body => name.to_json
  Hashie::Mash.new(response)
end

Instance Method Details

#deleteObject



42
43
44
45
# File 'lib/emaildirect/creative_folder.rb', line 42

def delete
  response = EmailDirect.delete uri_for, {}
  Hashie::Mash.new(response)
end

#detailsObject



27
28
29
30
# File 'lib/emaildirect/creative_folder.rb', line 27

def details
  response = get
  Hashie::Mash.new(response)
end

#templates(options = {}) ⇒ Object



32
33
34
35
# File 'lib/emaildirect/creative_folder.rb', line 32

def templates(options = {})
  response = get 'Templates', options
  Hashie::Mash.new(response)
end

#update(name) ⇒ Object



37
38
39
40
# File 'lib/emaildirect/creative_folder.rb', line 37

def update(name)
  response = EmailDirect.put uri_for, :body => name.to_json
  Hashie::Mash.new(response)
end