class DocuSign::Document

Constants

ATTRIBUTES

Attributes

tab_builder[W]

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/docu_sign/document.rb, line 10
def initialize(attributes = {})
  ATTRIBUTES.each do |attr|
    self.send("#{attr}=", attributes[attr])
  end
end

Public Instance Methods

tab(options = {}, &block) click to toggle source
# File lib/docu_sign/document.rb, line 28
def tab(options = {}, &block)
  tab_builder.build(options, &block).tap do |t|
    tabs << t
  end
end
tab_builder() click to toggle source
# File lib/docu_sign/document.rb, line 34
def tab_builder
  @tab_builder ||= DocuSign::Builder::TabBuilder.new(self)
end
tabs(recipient = nil) { |self| ... } click to toggle source
# File lib/docu_sign/document.rb, line 16
def tabs(recipient = nil, &block)
  @tabs ||= DocuSign::ArrayOfTab.new

  return @tabs unless block_given?

  self.tab_builder = DocuSign::Builder::TabBuilder.new(self, recipient)

  @tabs.tap do |a|
    yield self if block_given?
  end
end
to_savon() click to toggle source
# File lib/docu_sign/document.rb, line 38
def to_savon
  {
    "ID" => self.id,
    "Name" => self.name,
    "PDFBytes" => self.pdf_bytes,
    "Password" => self.password,
    "TransformPdfFields" => self.transform_pdf_fields,
    "FileExtension" => self.file_extension,
    "MatchBoxes" => self.match_boxes,
    "AttachmentDescription" => self.attachment_description
  }.delete_if{|key, value| value.nil?}
end