gentle 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f32f0c7a6f1a1b865917abd975208a9348f637d0
4
- data.tar.gz: 05243d09565638e9e54c3a19b9ee1327083059fa
3
+ metadata.gz: 36d0dad4c3c9a7e45655dfacd6e71bfff4c0f1d1
4
+ data.tar.gz: b546195997272fd408a86577a42fa1d20e7a5dc3
5
5
  SHA512:
6
- metadata.gz: fd2052df7216f4cc139239272236b1f3343168822bda7f61cb2b24cbc5aaf09e318125b56477d4bcd266daa9b076a796dff2190f42b9327d59480d1072697acf
7
- data.tar.gz: d469b745417d673de1a052d15407b172cfe4bbaa784f0928da1da16dab7ea6769a91c4f974ddd39681bc052e77c19f30f035be97b4fbec06de7cb858cf1cf9a2
6
+ metadata.gz: 78b86e3089d1c145a538b8a3610ddaf6e2a4b79d1e0f75972980bcef1b3f383b59927c16efccf29e9c281650c27d22775d063f8b129f35f0c18a4dbdc637d436
7
+ data.tar.gz: 0d43656434b811122d9a62a3d4ccf820fa450966974976b07df66bffa4c78e2f44bcde53221ae9853278153b9ea84589c4026c94fb338e8a4aa90c859dc09675
@@ -10,10 +10,20 @@ module Gentle
10
10
  @xml.serialize(encoding: "UTF-8")
11
11
  end
12
12
 
13
- def shipment_number
14
- result_description = @xml.css("ErrorMessage").first["ResultDescription"]
15
- match_data = result_description.match(/(.+)_(.+)_(.+)_.*.xml/) unless result_description.nil?
16
- match_data[2] unless match_data.nil?
13
+ def identifier
14
+ filename[2]
15
+ end
16
+ alias_method :shipment_number, :identifier
17
+
18
+ def object_type
19
+ filename[1] unless filename.nil?
20
+ end
21
+
22
+ def result_description
23
+ @result_description ||= @xml.css("ErrorMessage").first["ResultDescription"]
24
+ end
25
+ def filename
26
+ @filename ||= result_description.split('_') unless result_description.nil?
17
27
  end
18
28
  end
19
29
  end
@@ -1,3 +1,3 @@
1
1
  module Gentle
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -14,8 +14,12 @@ module Gentle
14
14
  assert_equal normalize(@xml_content), normalize(@message.to_xml)
15
15
  end
16
16
 
17
- it "extracts the shipment number from the error message" do
18
- assert_equal "H123456789", @message.shipment_number
17
+ it "extracts the identifier from the error message" do
18
+ assert_equal "H123456789", @message.identifier
19
+ end
20
+
21
+ it "extracts the object type from the error message" do
22
+ assert_equal "ShipmentOrder", @message.object_type
19
23
  end
20
24
 
21
25
  it "returns nil for shipment number if it cannot find it" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gentle
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DynamoMTL
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-14 00:00:00.000000000 Z
11
+ date: 2016-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk