Class: Echosign::Recipient

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

Instance Method Summary collapse

Methods included from Validatable

#require_exactly_one, #require_keys, #validate_field

Constructor Details

#initialize(params) ⇒ Echosign::Recipient

Creates an Echosign::Recipient object

Options Hash (params):

  • :role (String)

    ['SIGNER' or 'APPROVER']: Specify the role of recipient (REQUIRED)

  • :email (String)

    Email of the recipient. This is required if fax is not provided. Both fax and email can not be provided (email or fax REQUIRED)

  • :fax (String)

    Fax of the recipient. This is required if email is not provided. Both fax and email can not be provided (email or fax REQUIRED)

  • :securityOptions (Array)

    Security options that apply to the recipient. Populate the array with instances of Echosign::RecipientSecurityOption


15
16
17
18
19
# File 'lib/echosign/agreement/recipient.rb', line 15

def initialize(params)
  require_exactly_one([:email, :fax], params)
  email_or_fax = params[:email] ? {email:params[:email]} : {fax:params[:fax]}
  merge!(recipientSetMemberInfos:email_or_fax, recipientSetRole:params[:role])
end