Class: Newslettre::Letter::Recipients
- Defined in:
- lib/newslettre/letter.rb
Instance Attribute Summary collapse
-
#letter ⇒ Object
readonly
Returns the value of attribute letter.
Attributes inherited from APIModule
Instance Method Summary collapse
- #add(list) ⇒ Object
- #delete(list) ⇒ Object
- #get ⇒ Object (also: #list)
-
#initialize(letter, api) ⇒ Recipients
constructor
A new instance of Recipients.
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
#letter ⇒ Object (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 |
#get ⇒ Object 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 |