bluedart 0.1.1 → 0.1.2
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.
- checksums.yaml +8 -8
- data/lib/bluedart/base.rb +9 -5
- data/lib/bluedart/pincode_service.rb +2 -2
- data/lib/bluedart/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjEwZjJhOTcxOGQ5ZmRlYWE2M2I1NGRkNzUwMTZkODExMGExOTMxNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTQ0Yzc0YWVjMjlmYWJmNTc1N2FiZTkyOTEzMWE0MTliYzdlYTRmZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzdlZTk3YzczZmIzMWFlMjg5NjUyNTkxYTczY2U4NmUyMmRlMTdjZTBmZTBj
|
10
|
+
MjZkODBmZjZkY2RmYzQxZjhkYTliZGU5NWU1Njc3OTc1ODkyZGRmMDc3NmNi
|
11
|
+
ODk3ZTA3NmYzZTUzYTgwOGIzNzdlZGU0MDE0ZTNjYmM4MjFlMzU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODJkMGUyMWY4NGI3OTk3OTg5MzMxNDhkMTllZjgxNmRiNjFlNjM5NDJiODRh
|
14
|
+
YTBkOGU4ZWE2MTM2ZDM0ZWRhYTQ5NzE5NGE2NmYwZWIyODRmZjU0OTQyOTNk
|
15
|
+
YjQ3YWYxNjBkYzk3MmU1MjM5MjYxZWFlZmVkNTM5YTIyY2I0ODE=
|
data/lib/bluedart/base.rb
CHANGED
@@ -198,9 +198,9 @@ module Bluedart
|
|
198
198
|
response_hash[:error_text] = response[:error_message]
|
199
199
|
else
|
200
200
|
content = required_content(message, response)
|
201
|
-
if content[:is_error]
|
201
|
+
if content[:is_error] || content[:error]
|
202
202
|
response_hash[:error] = true
|
203
|
-
response_hash[:error_text] = content[:error_message] || content[:status]
|
203
|
+
response_hash[:error_text] = content[:error_message] || content[:status] || content[:error_text]
|
204
204
|
else
|
205
205
|
response_hash[:content] = content
|
206
206
|
end
|
@@ -216,9 +216,13 @@ module Bluedart
|
|
216
216
|
#
|
217
217
|
# Returns Hash
|
218
218
|
def required_content(prefix, content)
|
219
|
-
|
220
|
-
|
221
|
-
|
219
|
+
if content[:fault].nil?
|
220
|
+
prefix_s = prefix.snakecase
|
221
|
+
keys = (prefix_s + '_response').to_sym, (prefix_s + '_result').to_sym
|
222
|
+
return content[keys[0]][keys[1]]
|
223
|
+
else
|
224
|
+
return {error: true, error_text: content[:fault]}
|
225
|
+
end
|
222
226
|
end
|
223
227
|
|
224
228
|
# input params
|
@@ -8,9 +8,9 @@ module Bluedart
|
|
8
8
|
|
9
9
|
def request_url
|
10
10
|
if @mode == 'prod'
|
11
|
-
'
|
11
|
+
'http://netconnect.bluedart.com/ShippingAPI/Finder/ServiceFinderQuery.svc'
|
12
12
|
else
|
13
|
-
'
|
13
|
+
'http://netconnect.bluedart.com/Demo/ShippingAPI/Finder/ServiceFinderQuery.svc'
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
data/lib/bluedart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bluedart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CJ
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|