Sha256: 59a7ac409eb71a51efbc53dd488cc7a08087e8c02e637e2da0f4bb41824a6490

Contents?: true

Size: 862 Bytes

Versions: 11

Compression:

Stored size: 862 Bytes

Contents

module Qualtrics
  class RecipientImportRow
    attr_reader :recipient

    def initialize(recipient)
      @recipient = recipient
    end

    def to_a
      self.class.fields.map do |field|
        field_map[field]
      end
    end

    def field_map
      {
        'FirstName'    => recipient.first_name,
        'LastName'     => recipient.last_name,
        'Email'         => recipient.email,
        'EmbeddedData' => recipient.embedded_data,
        'ExternalData' => recipient.external_data,
        'Unsubscribed'  => recipient.unsubscribed,
        'Language'      => recipient.language
      }
    end
    class << self
      def fields
        [
          'FirstName',
          'LastName',
          'Email',
          'EmbeddedData',
          'ExternalData',
          'Unsubscribed',
          'Language'
        ]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
qualtrics-0.6.1 lib/qualtrics/recipient_import_row.rb
qualtrics-0.6.0 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.9b lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.9 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.8 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.7 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.6 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.5 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.4 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.3 lib/qualtrics/recipient_import_row.rb
qualtrics-0.5.2 lib/qualtrics/recipient_import_row.rb