Method: Contactology::Contact.create

Defined in:
lib/contactology/contact.rb

.create(attributes, options = {}) ⇒ Object

Public: Create a new contact. The only required attribute is an :email address.

Examples

Contactology::Contact.create(:email => '[email protected]')
# => #<Contactology::Contact:0x000... @email="[email protected]" ...>

Returns a Contactology::Contact instance when successful. Returns false when unsuccessful or a network error occurs.



33
34
35
36
# File 'lib/contactology/contact.rb', line 33

def self.create(attributes, options = {})
  contact = new(attributes)
  contact.save(options) ? contact : false
end