cfdi_processor 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cfdi_processor.rb +1 -0
- data/lib/cfdi_processor/data_extractor_base.rb +5 -4
- data/lib/cfdi_processor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 899a00e43777ff07c4ff554249a2ceb4070dc375986828ba6f2fd133c41c5230
|
4
|
+
data.tar.gz: 54c9bfbdc0fa09c62dc4fda6f1de6b5e0e11e587976a8a9ce7d46af1016058a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf8985366fad2bd104d70dd5f97ed3f322722ed5f871b9cf0206f0d20b3d03ce53e94b136c432345675e4d7d0625b5c74b811f7c61a14ddc0235edebf98199e
|
7
|
+
data.tar.gz: 38273c556fee3d09310569b791dd0574b6a1eb8f1c2b70781dc1295007d1460c3494d1c0b71f9f889088bbf88ccfdc966ffd4ef4c74ac940b5d3fa8e6d57d7ad
|
data/Gemfile.lock
CHANGED
data/lib/cfdi_processor.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'nokogiri'
|
2
|
-
require_relative "i18n"
|
3
2
|
|
4
3
|
module CfdiProcessor
|
5
4
|
class DataExtractorBase
|
@@ -9,6 +8,8 @@ module CfdiProcessor
|
|
9
8
|
@xml = xml
|
10
9
|
@nokogiri_xml = ::Nokogiri::XML(xml)
|
11
10
|
@nokogiri_xml.remove_namespaces!
|
11
|
+
I18n.load_path << File.expand_path("locale/en.yml", __dir__)
|
12
|
+
I18n.locale = :en
|
12
13
|
|
13
14
|
# => Hook methods:
|
14
15
|
#
|
@@ -39,12 +40,12 @@ module CfdiProcessor
|
|
39
40
|
if value.kind_of?(Array)
|
40
41
|
next if value.empty?
|
41
42
|
items = value.each do |item|
|
42
|
-
item.transform_keys!{ |k|
|
43
|
+
item.transform_keys!{ |k| I18n.t("#{args.first}.#{key}.#{k}") }
|
43
44
|
end
|
44
45
|
|
45
|
-
translated.merge!(
|
46
|
+
translated.merge!(I18n.t("#{args.first}.#{resource_name}.#{key}") => items)
|
46
47
|
else
|
47
|
-
translated.merge!(
|
48
|
+
translated.merge!(I18n.t("#{args.first}.#{resource_name}.#{key}") => value)
|
48
49
|
end
|
49
50
|
|
50
51
|
instance_variable_set("@#{resource_name}", translated)
|