dtefacil_xml_builder 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ module DtefacilXmlBuilder
2
+ class Errores
3
+ attr_accessor :errores, :error
4
+ def errores= xml
5
+ error_hash_map= XmlSimple.xml_in xml
6
+ @error= error_hash_map["error"].first["descripcion"]
7
+ end
8
+ end
9
+ end
@@ -21,5 +21,17 @@ module DtefacilXmlBuilder
21
21
  reader = DteCollectionReader.new
22
22
  reader.collection= response.body
23
23
  end
24
+
25
+ def read_errores
26
+ begin
27
+ response = RestClient.get "https://api.dtefacil.cl/1.2/documentos"
28
+ rescue Exception => e
29
+ er = Errores.new
30
+ er.errores= e.response
31
+ er.error
32
+ end
33
+
34
+
35
+ end
24
36
  end
25
37
  end
@@ -1,3 +1,3 @@
1
1
  module DtefacilXmlBuilder
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -1,4 +1,4 @@
1
- require "dtefacil_xml_builder/collection"
1
+ require "dtefacil_xml_builder/errores"
2
2
  require "dtefacil_xml_builder/factura_exenta_electronica"
3
3
  require "dtefacil_xml_builder/nota_de_credito_electronica"
4
4
  require "dtefacil_xml_builder/factura_electronica"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtefacil_xml_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-30 00:00:00.000000000 Z
12
+ date: 2012-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
@@ -74,10 +74,10 @@ files:
74
74
  - Rakefile
75
75
  - dtefacil_xml_builder.gemspec
76
76
  - lib/dtefacil_xml_builder.rb
77
- - lib/dtefacil_xml_builder/collection.rb
78
77
  - lib/dtefacil_xml_builder/detalle.rb
79
78
  - lib/dtefacil_xml_builder/dte_builder.rb
80
79
  - lib/dtefacil_xml_builder/dte_reader.rb
80
+ - lib/dtefacil_xml_builder/errores.rb
81
81
  - lib/dtefacil_xml_builder/factura_electronica.rb
82
82
  - lib/dtefacil_xml_builder/factura_exenta_electronica.rb
83
83
  - lib/dtefacil_xml_builder/nota_de_credito_electronica.rb
@@ -1,11 +0,0 @@
1
- module DtefacilXmlBuilder
2
-
3
- class DocumentoElectronico
4
- attr_accessor :id, :url, :fchEmis, :rutRecep, :rutEmisor, :tipo, :folio, :mntTotal
5
- end
6
-
7
- class Collection
8
- attr_accessor :pag, :tPag, :total, :pags, :documentos
9
- end
10
-
11
- end