Class: Newslettre::Lists::Email

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

Instance Attribute Summary collapse

Attributes inherited from APIModule

#api

Instance Method Summary collapse

Constructor Details

#initialize(list, api) ⇒ Email

Returns a new instance of Email.



55
56
57
58
# File 'lib/newslettre/lists.rb', line 55

def initialize list, api
  @list = list
  @api = api
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



53
54
55
# File 'lib/newslettre/lists.rb', line 53

def list
  @list
end

Instance Method Details

#add(*recipients) ⇒ Object



60
61
62
# File 'lib/newslettre/lists.rb', line 60

def add *recipients
  request 'add', :list => list, :data => recipients.map{|r| JSON.dump(r) }
end

#delete(*recipients) ⇒ Object



68
69
70
# File 'lib/newslettre/lists.rb', line 68

def delete *recipients
  request 'delete', :list => list, :email => recipients
end

#get(*recipients) ⇒ Object



64
65
66
# File 'lib/newslettre/lists.rb', line 64

def get *recipients
  request 'get', :list => list, :email => recipients
end