Class: FE::SignedDocument
- Inherits:
-
Object
- Object
- FE::SignedDocument
- Defined in:
- lib/facturacr/signed_document.rb
Instance Attribute Summary collapse
-
#base64 ⇒ Object
Returns the value of attribute base64.
-
#document ⇒ Object
Returns the value of attribute document.
-
#path ⇒ Object
Returns the value of attribute path.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
-
#initialize(document, path) ⇒ SignedDocument
constructor
A new instance of SignedDocument.
Constructor Details
#initialize(document, path) ⇒ SignedDocument
Returns a new instance of SignedDocument.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/facturacr/signed_document.rb', line 7 def initialize(document, path) @document = document @path = path @base64 = nil if File.exist?(@path) file = File.open(@path,"rb") @base64 = Base64.encode64(file.read).gsub("\n",""); end @payload = document.api_payload @payload[:comprobanteXml] = @base64 end |
Instance Attribute Details
#base64 ⇒ Object
Returns the value of attribute base64.
5 6 7 |
# File 'lib/facturacr/signed_document.rb', line 5 def base64 @base64 end |
#document ⇒ Object
Returns the value of attribute document.
5 6 7 |
# File 'lib/facturacr/signed_document.rb', line 5 def document @document end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/facturacr/signed_document.rb', line 5 def path @path end |
#payload ⇒ Object
Returns the value of attribute payload.
5 6 7 |
# File 'lib/facturacr/signed_document.rb', line 5 def payload @payload end |