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