Class: Signatory::Role

Inherits:
API::Base
  • Object
show all
Defined in:
lib/signatory/role.rb

Instance Method Summary collapse

Methods inherited from API::Base

all, connection, formatted_collection_name, formatted_name, #id, instantiate_collection

Instance Method Details

#emailObject



3
4
5
# File 'lib/signatory/role.rb', line 3

def email
  attributes['email'] || '[email protected]'
end

#to_xml(options = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/signatory/role.rb', line 7

def to_xml(options = {})
  identifier = {}
  identifier.merge!({:role_id => role_id}) unless attributes['role_id'].nil?
  identifier.merge!({:role_name => role_name}) unless attributes['role_name'].nil?
  require 'builder' unless defined? ::Builder
  options[:indent] ||= 2
  xml = options[:builder] ||= ::Builder::XmlMarkup.new(:indent => options[:indent])
  xml.role(identifier) do
    if attributes['name'].nil?
      xml.tag!('must-sign', must_sign)
      xml.tag!('document-role-id', document_role_id)
      xml.role role
      xml.tag!('is-sender', is_sender)
    else
      xml.name name
      xml.email email
    end
  end
end