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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f44d99329182eff27d60dff25449d91f8d14084f786c5168f93e8e3b672ce6b1
4
- data.tar.gz: 4a0442ea2b9d0e48315d18eae15185d0e77a213eb4a85f7893e986726012226b
3
+ metadata.gz: 81e2ba39cba54049cb049ddaa01817fe51e0e1212768359b0a0d5151b7de23f6
4
+ data.tar.gz: fcd351bc3eb4ed7325ebb35a74e9609e1437c5c63219ae679a5da036a71c496d
5
5
  SHA512:
6
- metadata.gz: 7526619b51b50993ad53b46322d8fedd345058bf0dec8b6ec77dca6794ea8cc5468122f98dda9b93b0bb1049fe75e835ed1cceb35c8f6b7f6507ba64d8c81148
7
- data.tar.gz: 850744a918e3a273c952d40e4ce8cb6cdfdb18d6c5cca3fd13ba903821b378ab94bf1302fa14e9d7dfe4bf63b3c0899205feb10630d6ceeb4d564c4cc9c6ae2a
6
+ metadata.gz: 1678dd35cf80cf95741ced1140eb208358f1ccf4ae2ec2da8af5e518feacba53acbf27c3e3afa61d26265bc1f459eb77c7c55b67ad0afefa1f19b35f0f1a314f
7
+ data.tar.gz: 4498ecff60bc76446b2e053e9908cadbe2f9a1f095eda8d4d1bcdfca916d9bc2a113d2ee4740faff730547426527ad965ef8e1a44e21fcfe1d0fb1dd975f7798
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps-imis-api (0.6.7)
4
+ usps-imis-api (0.6.8)
5
5
  activesupport (~> 8.0)
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -13,7 +13,7 @@ gem install usps-imis-api
13
13
  or add this line to your Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'usps-imis-api', '~> 0.6.3'
16
+ gem 'usps-imis-api'
17
17
  ```
18
18
 
19
19
  ## Setup
@@ -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(PanelProperties.build(&))
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 PanelProperties
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' => property_value(value)
33
+ 'Value' => wrap(value)
34
34
  }
35
35
  end
36
36
 
37
37
  private
38
38
 
39
- def property_value(value)
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')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.6.7'
5
+ VERSION = '0.6.8'
6
6
  end
7
7
  end
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/panel_properties'
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::PanelProperties do
5
+ describe Usps::Imis::Panel::Properties do
6
6
  let(:builder) { described_class.new }
7
7
 
8
- it 'handles boolean property values' do
9
- expect(builder.send(:property_value, true)).to eq(
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(:property_value, {}) }.to raise_error(
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.7
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/panel_properties.rb
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/panel_properties_spec.rb
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