Class: Mailchimp::Folders

Inherits:
Object
  • Object
show all
Defined in:
lib/mailchimp/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Folders



7
8
9
# File 'lib/mailchimp/api.rb', line 7

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



5
6
7
# File 'lib/mailchimp/api.rb', line 5

def master
  @master
end

Instance Method Details

#add(name, type) ⇒ Hash

Add a new folder to file campaigns, autoresponders, or templates in



16
17
18
19
# File 'lib/mailchimp/api.rb', line 16

def add(name, type)
    _params = {:name => name, :type => type}
    return @master.call 'folders/add', _params
end

#del(fid, type) ⇒ Hash

Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed



26
27
28
29
# File 'lib/mailchimp/api.rb', line 26

def del(fid, type)
    _params = {:fid => fid, :type => type}
    return @master.call 'folders/del', _params
end

#list(type) ⇒ Array

List all the folders of a certain type



39
40
41
42
# File 'lib/mailchimp/api.rb', line 39

def list(type)
    _params = {:type => type}
    return @master.call 'folders/list', _params
end

#update(fid, name, type) ⇒ Hash

Update the name of a folder for campaigns, autoresponders, or templates



50
51
52
53
# File 'lib/mailchimp/api.rb', line 50

def update(fid, name, type)
    _params = {:fid => fid, :name => name, :type => type}
    return @master.call 'folders/update', _params
end