Class: Docusign::Builder::TabBuilder
- Defined in:
- lib/docusign/builder/tab_builder.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#recipient ⇒ Object
Returns the value of attribute recipient.
Attributes inherited from Base
Instance Method Summary collapse
- #build(options = {}, &block) ⇒ Object
-
#initialize(document = nil, recipient = nil) ⇒ TabBuilder
constructor
A new instance of TabBuilder.
Methods inherited from Base
Constructor Details
#initialize(document = nil, recipient = nil) ⇒ TabBuilder
Returns a new instance of TabBuilder.
10 11 12 13 |
# File 'lib/docusign/builder/tab_builder.rb', line 10 def initialize(document = nil, recipient = nil) super self.document, self.recipient = document, recipient end |
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
6 7 8 |
# File 'lib/docusign/builder/tab_builder.rb', line 6 def document @document end |
#recipient ⇒ Object
Returns the value of attribute recipient.
6 7 8 |
# File 'lib/docusign/builder/tab_builder.rb', line 6 def recipient @recipient end |
Instance Method Details
#build(options = {}, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/docusign/builder/tab_builder.rb', line 15 def build( = {}, &block) = .delete(:anchor) returning super(, &block) do |tab| tab.anchor if && !tab.anchor_tab_item tab.document_id ||= document.id if document tab.recipient_id ||= recipient.id if recipient # Default tab_label to the tab name if none is explicitly given tab.tab_label ||= tab.name # Provide a custom tab type if none has already been provided tab.type ||= Docusign::TabTypeCode::Custom end end |