Class: Mailtrap::ContactImportsAPI
- Inherits:
-
Object
- Object
- Mailtrap::ContactImportsAPI
- Includes:
- BaseAPI
- Defined in:
- lib/mailtrap/contact_imports_api.rb
Instance Attribute Summary
Attributes included from BaseAPI
Instance Method Summary collapse
-
#create(contacts) ⇒ ContactImport
(also: #start)
Create contacts import.
-
#get(import_id) ⇒ ContactImport
Retrieves a specific contact import.
Methods included from BaseAPI
Instance Method Details
#create(contacts) ⇒ ContactImport Also known as: start
Create contacts import
46 47 48 49 50 51 52 |
# File 'lib/mailtrap/contact_imports_api.rb', line 46 def create(contacts) contact_data = contacts.to_a.each do |contact| (contact, ) end response = client.post(base_path, contacts: contact_data) handle_response(response) end |
#get(import_id) ⇒ ContactImport
Retrieves a specific contact import
18 19 20 |
# File 'lib/mailtrap/contact_imports_api.rb', line 18 def get(import_id) base_get(import_id) end |