Class: Echosign::Agreement

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echosign/agreement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(user_id = nil, user_email = nil, params) ⇒ Echosign::Agreement

Creates an agreement object for submission

Options Hash (params):

  • :fileInfos (Array)

    A list of one or more files (or references to files) that will be sent out for signature. If more than one file is provided, they will be combined into one PDF before being sent out. Note: Only one of the four parameters in every FileInfo object must be specified. Populate the array with instances of Echosign::Fileinfo (REQUIRED)

  • :recipientSetInfos (Array)

    A list of one or more recipients. For regular (non-MegaSign) documents, there is no limit on the number of electronic signatures in a single document. Written signatures are limited to four per document. This limit includes the sender if the sender's signature is also required. Populate the array with instances of Echosign::Recipient (REQUIRED)

  • :signatureFlow (String)

    ['SENDER_SIGNATURE_NOT_REQUIRED' or 'SENDER_SIGNS_LAST' or 'SENDER_SIGNS_FIRST' or 'SEQUENTIAL' or 'PARALLEL']: Selects the workflow you would like to use - whether the sender needs to sign before the recipient, after the recipient, or not at all. The possible values for this variable are SENDER_SIGNATURE_NOT_REQUIRED, SENDER_SIGNS_LAST, SENDER_SIGNS_FIRST, SEQUENTIAL or PARALLEL. (REQUIRED)

  • :signatureType (String)

    ['ESIGN' or 'WRITTEN']: Specifies the type of signature you would like to request - written or eSignature. The possible values are ESIGN or WRITTEN (REQUIRED)

  • :name (String)

    The name of the agreement that will be used to identify it, in emails and on the website. (REQUIRED)


25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/echosign/agreement.rb', line 25

def initialize(user_id=nil, user_email=nil, params)
  @user_id = user_id
  @user_email = user_email
  #TODO (cthomas) barf if user_id or user_email are blank
  if params.has_key?(:recipients)
    warn("NOTE: :recipients param in #{self.class}.new is deprecated; use :recipientSetInfos instead.\n" +
         "#{self.class}.new called from #{Gem.location_of_caller.join(":")}")
    params = params.dup
    params[:recipientSetInfos] ||= params.delete :recipients
  end
  require_keys([:signatureType, :recipientSetInfos, :signatureFlow, :fileInfos, :name], params)
  merge!({ documentCreationInfo: params })
end

Instance Attribute Details

#user_emailObject

Returns the value of attribute user_email


12
13
14
# File 'lib/echosign/agreement.rb', line 12

def user_email
  @user_email
end

#user_idObject

Returns the value of attribute user_id


12
13
14
# File 'lib/echosign/agreement.rb', line 12

def user_id
  @user_id
end