Class: Newslettre::Letter

Inherits:
APIModule show all
Defined in:
lib/newslettre/letter.rb

Defined Under Namespace

Classes: NotScheduledFailure, Object, Recipients, Schedule

Instance Attribute Summary

Attributes inherited from APIModule

#api

Instance Method Summary collapse

Methods inherited from APIModule

#initialize

Constructor Details

This class inherits a constructor from Newslettre::APIModule

Instance Method Details

#add(name, data = {}) ⇒ Object



59
60
61
# File 'lib/newslettre/letter.rb', line 59

def add name, data = {}
  request 'add', data.merge(:name => name)
end

#delete(name) ⇒ Object



67
68
69
# File 'lib/newslettre/letter.rb', line 67

def delete name
  request 'delete', :name => name
end

#edit(name, data = {}) ⇒ Object



71
72
73
# File 'lib/newslettre/letter.rb', line 71

def edit name, data = {}
  request 'edit', data
end

#get(name) ⇒ Object



63
64
65
# File 'lib/newslettre/letter.rb', line 63

def get name
  Object.new self, name
end

#listObject



53
54
55
56
57
# File 'lib/newslettre/letter.rb', line 53

def list
  request('list').map do |n|
    Object.new self, n["name"]
  end
end