Class: DocuSign::EnvelopeStatus

Inherits:
DocuSignModel show all
Defined in:
lib/docu_sign/envelope_status.rb

Constant Summary collapse

ATTRIBUTES =
[:recipient_statuses, :time_generated, :envelope_id, :subject, :user_name, :email, :status, :created, :deleted, :sent, :delivered, :signed, :completed, :declined, :timed_out,
:ac_status, :ac_status_date, :ac_holder, :ac_holder_email, :ac_holder_location, :signing_location, :sender_ip_address, :envelope_pdf_hash, :custom_field, :vaulting_details, :envelope_stamping,
:authoritative_copy, :envelope_attachment, :document_statuses, :form_data]

Instance Method Summary collapse

Methods inherited from DocuSignModel

#method_missing, #to_savon

Constructor Details

#initialize(attributes = {}) ⇒ EnvelopeStatus

Returns a new instance of EnvelopeStatus.



10
11
12
13
14
# File 'lib/docu_sign/envelope_status.rb', line 10

def initialize(attributes = {})
  ATTRIBUTES.each do |attr|
    self.send("#{attr}=", attributes[attr])
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DocuSign::DocuSignModel

Instance Method Details

#document_statuses=(status_attributes) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/docu_sign/envelope_status.rb', line 24

def document_statuses=(status_attributes)
  if status_attributes && status_attributes[:document_status].is_a?(Hash)
    @document_statuses = [DocumentStatus.new(status_attributes[:document_status])]
  elsif status_attributes && status_attributes[:document_status].is_a?(Array)
    @document_statuses = status_attributes[:document_status].map{|attributes| DocuSign::DocumentStatus.new(attributes)}
  end
end

#recipient_statuses=(status_attributes) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/docu_sign/envelope_status.rb', line 16

def recipient_statuses=(status_attributes)
  if status_attributes && status_attributes[:recipient_status].is_a?(Hash)
    @recipient_statuses = [RecipientStatus.new(status_attributes[:recipient_status])]
  elsif status_attributes && status_attributes[:recipient_status].is_a?(Array)
    @recipient_statuses = status_attributes[:recipient_status].map{|attributes| DocuSign::RecipientStatus.new(attributes)}
  end
end