Class: Esignatur::Pades
- Inherits:
-
Object
- Object
- Esignatur::Pades
- Defined in:
- lib/esignatur/pades.rb
Overview
esignature PAdES document representation. More info: api.esignatur.dk/Documentation/Pades
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
Instance Method Summary collapse
- #document_data ⇒ Object
-
#initialize(order:, api:) ⇒ Pades
constructor
A new instance of Pades.
- #response_body ⇒ Object
Constructor Details
#initialize(order:, api:) ⇒ Pades
Returns a new instance of Pades.
9 10 11 12 |
# File 'lib/esignatur/pades.rb', line 9 def initialize(order:, api:) @order = order @api = api end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
7 8 9 |
# File 'lib/esignatur/pades.rb', line 7 def order @order end |
Instance Method Details
#document_data ⇒ Object
14 15 16 |
# File 'lib/esignatur/pades.rb', line 14 def document_data Base64.decode64(response_body.fetch('DocumentData')) end |
#response_body ⇒ Object
18 19 20 21 |
# File 'lib/esignatur/pades.rb', line 18 def response_body @response_body ||= \ api.post('Pades/Download', data: { 'Id' => order.id, 'DocumentIndex' => 0 }).json_body end |