Sha256: b58f4d33196a01be7eccce556644d61b3a6b3054cf9ac875702cd6d83d05230f

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

#
# add_contacts_import_data.rb
# ConstantContact
#
# Copyright (c) 2013 Constant Contact. All rights reserved.

module ConstantContact
  module Components
    class AddContactsImportData < Component
      attr_accessor :first_name, :middle_name, :last_name, :job_title, :company_name,
                    :work_phone, :home_phone, :email_addresses, :addresses, :custom_fields


      # Constructor to create an AddContactsImportData object from the given hash
      # @param [Hash] props - the hash with properties
      # @return [AddContactsImportData]
      def initialize(props = {})
        instance_variables.each do |property, value|
          send("#{property}=", get_value(props, property))
        end
      end

      # Setter
      def add_custom_field(custom_field)
        @custom_fields = [] if @custom_fields.nil?
        @custom_fields << custom_field
      end


      # Setter
      def add_address(address)
        @addresses = [] if @addresses.nil?
        @addresses << address
      end


      # Setter
      def add_email(email_address)
        @email_addresses = [] if @email_addresses.nil?
        @email_addresses << email_address
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
constantcontact-1.0.1 lib/constantcontact/components/activities/add_contacts_import_data.rb