Class: Universign::Transaction
- Inherits:
-
Object
- Object
- Universign::Transaction
- Includes:
- Safeguard, Service::Document, Service::Transaction
- Defined in:
- lib/universign/transaction.rb
Constant Summary
Constants included from Service::Transaction
Service::Transaction::AVAILABLE_OPTIONS, Service::Transaction::DEFAULT_OPTIONS
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
- #url ⇒ Array<String> readonly
Instance Method Summary collapse
-
#created_at ⇒ Date
The creation date or last relaunch date of this transaction.
-
#current_signer ⇒ Integer
The index of current signer if the status of transaction is ready or who ended the transactions for other status.
-
#description ⇒ String
The description of the Transaction.
-
#each_field ⇒ Boolean
Whether the transaction was requested with requesting handwritten signature for each signature field or not.
- #from_data(data) ⇒ Object
-
#initialize(transaction_id = nil, url = nil) ⇒ Transaction
constructor
A new instance of Transaction.
-
#initiator ⇒ Object
A bean containing information about the requester of a transaction.
-
#signed? ⇒ Boolean
Whether the transaction is signed…
-
#signers ⇒ Array<Universign::Signer]
A list of bean containing information about the signers and their progression in the signature process.
-
#status ⇒ String
The status of the transaction.
Methods included from Service::Document
Methods included from Service::Transaction
Methods included from Safeguard
Constructor Details
#initialize(transaction_id = nil, url = nil) ⇒ Transaction
Returns a new instance of Transaction.
9 10 11 12 13 14 15 |
# File 'lib/universign/transaction.rb', line 9 def initialize(transaction_id = nil, url = nil) @transaction_id = transaction_id @url = url @data = {} self.get end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/universign/transaction.rb', line 7 def data @data end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
7 8 9 |
# File 'lib/universign/transaction.rb', line 7 def transaction_id @transaction_id end |
#url ⇒ Array<String> (readonly)
37 38 39 |
# File 'lib/universign/transaction.rb', line 37 def url @url end |
Instance Method Details
#created_at ⇒ Date
The creation date or last relaunch date of this transaction
67 68 69 |
# File 'lib/universign/transaction.rb', line 67 def created_at data['creationDate'].to_date end |
#current_signer ⇒ Integer
The index of current signer if the status of transaction is ready or who ended the transactions for other status
60 61 62 |
# File 'lib/universign/transaction.rb', line 60 def current_signer data['currentSigner'] end |
#description ⇒ String
The description of the Transaction
74 75 76 |
# File 'lib/universign/transaction.rb', line 74 def description data['description'] end |
#each_field ⇒ Boolean
Whether the transaction was requested with requesting handwritten signature for each signature field or not.
82 83 84 |
# File 'lib/universign/transaction.rb', line 82 def each_field data['eachField'] end |
#from_data(data) ⇒ Object
17 18 19 |
# File 'lib/universign/transaction.rb', line 17 def from_data(data) @data = data end |
#initiator ⇒ Object
A bean containing information about the requester of a transaction
52 53 54 |
# File 'lib/universign/transaction.rb', line 52 def initiator data['initiatorInfo'] end |
#signed? ⇒ Boolean
Whether the transaction is signed… or not !
89 90 91 |
# File 'lib/universign/transaction.rb', line 89 def signed? status == 'completed' end |
#signers ⇒ Array<Universign::Signer]
A list of bean containing information about the signers and their progression in the signature process
45 46 47 |
# File 'lib/universign/transaction.rb', line 45 def signers raise 'NotImplementedYet' end |
#status ⇒ String
The status of the transaction. The existing statuses are:
| Status | Description | |————-|————————————————————————————————–| | ‘ready` | Signers can connect and sign | | `expired` | The transaction has been requested more than 7 days ago. It will no more be available to signers | | `canceled` | A signer has canceled the transaction. Signers will no more be able to connect to the service | | `failed` | An error occured during a signature. The signers won’t be able to connect to the service | | `completed` | All signers have successfuly sign, the requester can retrieve the documents |
32 33 34 |
# File 'lib/universign/transaction.rb', line 32 def status data['status'] end |