Class: Echochamber::Agreement

Inherits:
Hash
  • Object
show all
Includes:
Validatable
Defined in:
lib/echochamber/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) ⇒ Echochamber::Agreement

Creates an agreement object for submission

Parameters:

  • user_id (String) (defaults to: nil)

    ID of the user whom this agreement is made for

  • user_email (String) (defaults to: nil)

    Email of the user whom this agreement is made for

  • params (Hash)

    SYMBOL-referenced Hash containing:

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 Echochamber::Fileinfo (REQUIRED)

  • :recipients (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 Echochamber::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)



23
24
25
26
27
28
29
# File 'lib/echochamber/agreement.rb', line 23

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
  require_keys([:signatureType, :recipients, :signatureFlow, :fileInfos, :name], params)
  merge!({ documentCreationInfo: params })
end

Instance Attribute Details

#user_emailObject

Returns the value of attribute user_email.



10
11
12
# File 'lib/echochamber/agreement.rb', line 10

def user_email
  @user_email
end

#user_idObject

Returns the value of attribute user_id.



10
11
12
# File 'lib/echochamber/agreement.rb', line 10

def user_id
  @user_id
end