Method: BeeiqAPI::Contact#initialize

Defined in:
lib/beeiq_api/contact.rb

#initialize(options = {}) ⇒ Contact

Returns a new instance of Contact.

Raises:

  • (ArgumentError)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/beeiq_api/contact.rb', line 18

def initialize(options = {})
  @contact_type = options[:contact_type] || Config::ContactType::CUSTOMER
  @name = options[:name]
  @lastname = options[:lastname]
  @title = options[:title]
  @passport = options[:passport]
  @gender = options[:gender]
  @date_of_birth = options[:date_of_birth]
  @emails = options[:emails]
  @phones = options[:phones]
  @addresses = options[:addresses]
  @im = options[:im]
  @tag = options[:tag]
  @cus_fields = options[:cus_fields]
  @company_contact = options[:company_contact]

  raise ArgumentError, 'name is required' if @name.to_s.empty?
end