Class: Mailstro::ListUnsubscribe

Inherits:
Resource
  • Object
show all
Defined in:
lib/mailstro/list_unsubscribe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contact_email, list_type, list_name) ⇒ ListUnsubscribe

Returns a new instance of ListUnsubscribe.



5
6
7
8
9
# File 'lib/mailstro/list_unsubscribe.rb', line 5

def initialize(contact_email, list_type, list_name)
  @contact_email = contact_email
  @list_type     = list_type
  @list_name     = list_name
end

Instance Attribute Details

#contact_emailObject (readonly)

Returns the value of attribute contact_email.



3
4
5
# File 'lib/mailstro/list_unsubscribe.rb', line 3

def contact_email
  @contact_email
end

#list_nameObject (readonly)

Returns the value of attribute list_name.



3
4
5
# File 'lib/mailstro/list_unsubscribe.rb', line 3

def list_name
  @list_name
end

#list_typeObject (readonly)

Returns the value of attribute list_type.



3
4
5
# File 'lib/mailstro/list_unsubscribe.rb', line 3

def list_type
  @list_type
end

Instance Method Details

#deliverObject



11
12
13
14
15
16
17
# File 'lib/mailstro/list_unsubscribe.rb', line 11

def deliver
  delete("lists/subscribers",
         :contact_email => @contact_email,
         :list_type     => @list_type,
         :list_name     => @list_name
  )
end