usps-imis-api 0.6.7 → 0.6.8
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 +4 -4
- data/Gemfile.lock +1 -1
- data/Readme.md +1 -1
- data/lib/usps/imis/panel/base_panel.rb +1 -1
- data/lib/usps/imis/panel/{panel_properties.rb → properties.rb} +5 -5
- data/lib/usps/imis/version.rb +1 -1
- data/lib/usps/imis.rb +1 -1
- data/spec/lib/usps/imis/panel/{panel_properties_spec.rb → properties_spec.rb} +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 81e2ba39cba54049cb049ddaa01817fe51e0e1212768359b0a0d5151b7de23f6
|
|
4
|
+
data.tar.gz: fcd351bc3eb4ed7325ebb35a74e9609e1437c5c63219ae679a5da036a71c496d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1678dd35cf80cf95741ced1140eb208358f1ccf4ae2ec2da8af5e518feacba53acbf27c3e3afa61d26265bc1f459eb77c7c55b67ad0afefa1f19b35f0f1a314f
|
|
7
|
+
data.tar.gz: 4498ecff60bc76446b2e053e9908cadbe2f9a1f095eda8d4d1bcdfca916d9bc2a113d2ee4740faff730547426527ad965ef8e1a44e21fcfe1d0fb1dd975f7798
|
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
|
@@ -94,7 +94,7 @@ module Usps
|
|
|
94
94
|
|
|
95
95
|
def identity_type = 'System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib'
|
|
96
96
|
|
|
97
|
-
def build_payload(data, &) = payload_header(data).merge(
|
|
97
|
+
def build_payload(data, &) = payload_header(data).merge(Properties.build(&))
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
end
|
|
@@ -5,12 +5,12 @@ module Usps
|
|
|
5
5
|
module Panel
|
|
6
6
|
# Constructor for the Properties field for Panel requests
|
|
7
7
|
#
|
|
8
|
-
class
|
|
9
|
-
# Build a new Properties field
|
|
8
|
+
class Properties
|
|
9
|
+
# Build the data for a new Properties field
|
|
10
10
|
#
|
|
11
11
|
def self.build(&) = new.build(&)
|
|
12
12
|
|
|
13
|
-
# Build the Properties field
|
|
13
|
+
# Build the data for the Properties field
|
|
14
14
|
#
|
|
15
15
|
def build
|
|
16
16
|
yield(self)
|
|
@@ -30,13 +30,13 @@ module Usps
|
|
|
30
30
|
@properties << {
|
|
31
31
|
'$type' => 'Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts',
|
|
32
32
|
'Name' => name,
|
|
33
|
-
'Value' =>
|
|
33
|
+
'Value' => wrap(value)
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
private
|
|
38
38
|
|
|
39
|
-
def
|
|
39
|
+
def wrap(value)
|
|
40
40
|
case value
|
|
41
41
|
when String then value
|
|
42
42
|
when Time, DateTime then value.strftime('%Y-%m-%dT%H:%I:%S')
|
data/lib/usps/imis/version.rb
CHANGED
data/lib/usps/imis.rb
CHANGED
|
@@ -23,7 +23,7 @@ require_relative 'imis/business_object'
|
|
|
23
23
|
require_relative 'imis/api'
|
|
24
24
|
require_relative 'imis/mapper'
|
|
25
25
|
require_relative 'imis/panel/base_panel'
|
|
26
|
-
require_relative 'imis/panel/
|
|
26
|
+
require_relative 'imis/panel/properties'
|
|
27
27
|
require_relative 'imis/panel/vsc'
|
|
28
28
|
require_relative 'imis/panel/education'
|
|
29
29
|
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
require 'spec_helper'
|
|
4
4
|
|
|
5
|
-
describe Usps::Imis::Panel::
|
|
5
|
+
describe Usps::Imis::Panel::Properties do
|
|
6
6
|
let(:builder) { described_class.new }
|
|
7
7
|
|
|
8
|
-
it '
|
|
9
|
-
expect(builder.send(:
|
|
8
|
+
it 'wraps boolean property values' do
|
|
9
|
+
expect(builder.send(:wrap, true)).to eq(
|
|
10
10
|
'$type' => 'System.Boolean', '$value' => true
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
it 'raises an error for unexpected property types' do
|
|
15
|
-
expect { builder.send(:
|
|
15
|
+
expect { builder.send(:wrap, {}) }.to raise_error(
|
|
16
16
|
Usps::Imis::Error::ApiError, 'Unexpected property type: {}'
|
|
17
17
|
)
|
|
18
18
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: usps-imis-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julian Fiander
|
|
@@ -52,7 +52,7 @@ files:
|
|
|
52
52
|
- lib/usps/imis/mapper.rb
|
|
53
53
|
- lib/usps/imis/panel/base_panel.rb
|
|
54
54
|
- lib/usps/imis/panel/education.rb
|
|
55
|
-
- lib/usps/imis/panel/
|
|
55
|
+
- lib/usps/imis/panel/properties.rb
|
|
56
56
|
- lib/usps/imis/panel/vsc.rb
|
|
57
57
|
- lib/usps/imis/requests.rb
|
|
58
58
|
- lib/usps/imis/version.rb
|
|
@@ -64,7 +64,7 @@ files:
|
|
|
64
64
|
- spec/lib/usps/imis/mapper_spec.rb
|
|
65
65
|
- spec/lib/usps/imis/panel/base_panel_spec.rb
|
|
66
66
|
- spec/lib/usps/imis/panel/education_spec.rb
|
|
67
|
-
- spec/lib/usps/imis/panel/
|
|
67
|
+
- spec/lib/usps/imis/panel/properties_spec.rb
|
|
68
68
|
- spec/lib/usps/imis/panel/vsc_spec.rb
|
|
69
69
|
- spec/lib/usps/imis_spec.rb
|
|
70
70
|
- spec/spec_helper.rb
|