Class: Newslettre::Letter::Recipients

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

Instance Attribute Summary collapse

Attributes inherited from APIModule

#api

Instance Method Summary collapse

Constructor Details

#initialize(letter, api) ⇒ Recipients

Returns a new instance of Recipients.



133
134
135
136
# File 'lib/newslettre/letter.rb', line 133

def initialize letter, api
  @letter = letter
  @api = api
end

Instance Attribute Details

#letterObject (readonly)

Returns the value of attribute letter.



131
132
133
# File 'lib/newslettre/letter.rb', line 131

def letter
  @letter
end

Instance Method Details

#add(list) ⇒ Object



138
139
140
# File 'lib/newslettre/letter.rb', line 138

def add list
  request 'add', { :list => list, :name => letter }
end

#delete(list) ⇒ Object



149
150
151
# File 'lib/newslettre/letter.rb', line 149

def delete list
  request 'delete', { :list => list, :name => letter }
end

#getObject Also known as: list



142
143
144
145
146
# File 'lib/newslettre/letter.rb', line 142

def get
  request('get', { :name => letter }).map do |l|
    Newslettre::Lists::Object.new self, l["list"]
  end
end