bill_forward 1.2015.217.1 → 1.2015.299

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
  SHA512:
3
- metadata.gz: 36859defb8b4cab57fd19f2d43a18f5173c0aafef9f81b02432089bcdb5abc304f1a9bd0fc822812b8b033a0b5da27ce50d694bbd9917fe7b58e357e45ed9304
4
- data.tar.gz: 43962803784339c2d072b47db0254ca0ea9fdde0b03fb86e1c613a084fc271555c05046263df70b478c9b48a37be52f5625c059de82eb1837ae5486f1e8d7ad4
3
+ metadata.gz: 8b6186a0858cafc36662c6fcb761f1a350c17a01cd3a049ea6bae070771e926bf7b4e46a50492665699a32fda6312e70489a9cfb16c83c81b2b2410b7d6cc5ef
4
+ data.tar.gz: d5ad4c99fe1425d16304f73ac9e9c0d60ce561b7e85e65639202be1304615a2f5ad0e652c3f91eb619bfb86858e836aef2e5976d860c20938db228753c058bf0
5
5
  SHA1:
6
- metadata.gz: 32d9639dc234eac3ca071cf6b7fcef5f9b53c63a
7
- data.tar.gz: 8ac698214ccdc10359278cb6cc813af19c1fd35c
6
+ metadata.gz: dedb74886895df84e04ab95723ecbd9e9fd17f02
7
+ data.tar.gz: 32b95e265d1fe4c801591d0342525970b1dca7a3
data/.gitignore CHANGED
@@ -26,4 +26,5 @@ onelinechange.bat
26
26
  twolinechange.bat
27
27
  spec/test_constants.rb
28
28
  scratch/scratch.rb
29
- *.scratch.rb
29
+ *.scratch.rb
30
+ scratch/rails/*
@@ -173,19 +173,40 @@ module BillForward
173
173
  method_missing(set_key, value)
174
174
  end
175
175
 
176
+ def state_params
177
+ @_state_params
178
+ end
179
+
180
+ def serialize_field(field)
181
+ if field.is_a? BillingEntity
182
+ serialize_field field.state_params
183
+ elsif field.is_a? Array
184
+ # return a transformed array, where each field has been serialized
185
+ field.map do |iterand|
186
+ serialize_field iterand
187
+ end
188
+ elsif field.is_a? Hash
189
+ # the lengths I have to go to achieve immutability in Ruby 1.8.7
190
+ clone = hash_with_type_at_top field
191
+ clone.each do |key, value|
192
+ clone[key] = serialize_field value
193
+ end
194
+ clone
195
+ else
196
+ field
197
+ end
198
+ end
199
+
176
200
  def to_ordered_hash
177
- ordered_hash = hash_with_type_at_top(@_state_params)
178
- ordered_hash
201
+ serialize_field self
179
202
  end
180
203
 
181
204
  def to_json(*a)
182
- ordered_hash = to_ordered_hash
183
- ordered_hash.to_json
184
- # @_state_params.to_json
205
+ to_ordered_hash.to_json
185
206
  end
186
207
 
187
208
  def to_unordered_hash
188
- json_string = to_json
209
+ json_string = to_json.to_s
189
210
  JSON.parse(json_string)
190
211
  end
191
212
 
@@ -295,7 +295,7 @@ module BillForward
295
295
  error = split.first.split('=').last
296
296
  description = split.last.split('=').last
297
297
 
298
- raise_message = "\n====\n#{rcode} Authorization failed.\nType: #{type}\nError: #{error}\nDescription: #{description}\n====\n"
298
+ raise_message = "\n====\n#{rcode} Authorization failed.\nType: #{errorType}\nError: #{error}\nDescription: #{description}\n====\n"
299
299
 
300
300
  raise ApiAuthorizationError.new(error, rbody), raise_message
301
301
  else
@@ -1,4 +1,4 @@
1
1
  module BillForward
2
2
  # in an rspec run, the gemspec and bill_forward.rb loader will both visit this
3
- VERSION = "1.2015.217.1" unless const_defined?(:VERSION)
3
+ VERSION = "1.2015.299" unless const_defined?(:VERSION)
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bill_forward
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2015.217.1
4
+ version: 1.2015.299
5
5
  platform: ruby
6
6
  authors:
7
7
  - BillForward
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2015-08-06 00:00:00 Z
12
+ date: 2015-10-27 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client