Sha256: bfc57e25a86c1b6694c55cfb328eec76fe70e8f86fe3bdd562fad59d2a062f74

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

require 'configatron'

require "qualtrics/configuration"
require "qualtrics/version"
require "qualtrics/operation"
require "qualtrics/response"
require "qualtrics/entity"
require "qualtrics/recipient"
require "qualtrics/panel"
require "qualtrics/panel_import"
require "qualtrics/survey"
require "qualtrics/survey_import"

require "qualtrics/message"
require "qualtrics/distribution"
require "qualtrics/submission"
require "qualtrics/mailer"

# not always necessary for runtime
# consider adding only when necessary
require "qualtrics/transaction"

module Qualtrics
  def self.configure(&block)
    configuration.update(&block)
  end

  def self.configuration
    if !configatron.has_key?(:qualtrics)
      configatron.qualtrics = Configuration.new
    end
    configatron.qualtrics
  end

  class << self
    def begin_transaction!
      configatron.qualtrics_transaction = Qualtrics::Transaction.new
      Qualtrics::Operation.add_listener(configatron.qualtrics_transaction)
    end

    def rollback_transaction!
      if configatron.has_key?(:qualtrics_transaction)
        configatron.qualtrics_transaction.rollback!
        Qualtrics::Operation.delete_listener(configatron.qualtrics_transaction)
      end
    end
  end

  class Error < StandardError; end
  class ServerErrorEncountered < Error; end
  class UpdateNotAllowed < Error; end
  class UnexpectedRequestMethod < Error; end
  class UnexpectedContentType < Error; end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
qualtrics-0.6.1 lib/qualtrics.rb
qualtrics-0.6.0 lib/qualtrics.rb
qualtrics-0.5.9b lib/qualtrics.rb
qualtrics-0.5.9 lib/qualtrics.rb
qualtrics-0.5.8 lib/qualtrics.rb