Class: Ilovepdf::Signature::Receiver
- Inherits:
-
Object
- Object
- Ilovepdf::Signature::Receiver
- Defined in:
- lib/ilovepdf/signature/receiver.rb
Constant Summary collapse
- ALLOWED_TYPES =
[:signer,:validator,:viewer]
Instance Attribute Summary collapse
-
#access_code ⇒ Object
Returns the value of attribute access_code.
-
#email ⇒ Object
Returns the value of attribute email.
-
#force_signature_type ⇒ Object
Returns the value of attribute force_signature_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #<<(element) ⇒ Object (also: #add_receiver)
- #elements ⇒ Object
-
#initialize(type, name, email, phone = nil) ⇒ Receiver
constructor
A new instance of Receiver.
- #to_h ⇒ Object
Constructor Details
#initialize(type, name, email, phone = nil) ⇒ Receiver
Returns a new instance of Receiver.
7 8 9 10 11 12 |
# File 'lib/ilovepdf/signature/receiver.rb', line 7 def initialize(type,name,email, phone=nil) @type = type @name = name @email = email @phone = phone end |
Instance Attribute Details
#access_code ⇒ Object
Returns the value of attribute access_code.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def access_code @access_code end |
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def email @email end |
#force_signature_type ⇒ Object
Returns the value of attribute force_signature_type.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def force_signature_type @force_signature_type end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def name @name end |
#phone ⇒ Object
Returns the value of attribute phone.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def phone @phone end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/ilovepdf/signature/receiver.rb', line 6 def type @type end |
Instance Method Details
#<<(element) ⇒ Object Also known as: add_receiver
48 49 50 51 52 53 |
# File 'lib/ilovepdf/signature/receiver.rb', line 48 def <<(element) raise ::Ilovepdf::Errors::ArgumentError.new("Only Ilovepdf::Signature::FileElement type of object is allowed") unless element.is_a?(::Ilovepdf::Signature::FileElement) @elements ||= [] @elements << element elements end |
#elements ⇒ Object
44 45 46 |
# File 'lib/ilovepdf/signature/receiver.rb', line 44 def elements @elements ||= [] end |
#to_h ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ilovepdf/signature/receiver.rb', line 56 def to_h { name: name, email: email, phone: phone, type: type, access_code: access_code, force_signature_type: force_signature_type, files: files_to_hash } end |