portmone 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: fbef92295772ffc52b3616defad53cd79fa6238f
4
- data.tar.gz: a600e56865873ca230b817a08fd4b7fb6f8a6b0a
3
+ metadata.gz: 32ea5452ae05d3b3b3a00e6518eb33cf42b735d2
4
+ data.tar.gz: '0194704ea315d16f9b9f157282fa6832f84784c6'
5
5
  SHA512:
6
- metadata.gz: ab23d1e8b35cd84eb961c51415d0ac17f0669e71c5b16791b8a533ce5c736ce50a81cb56d85e13002ae4979294815d2f540bb57a4e31bd79a8f3001ece86fab3
7
- data.tar.gz: e55629511692efefdaeb841550471bbf4d2d3db08458a2f7d26fd48dd4ec5465bee2bcfb941c39822295da42e526f3e9b31bdee020f060bd764d421c8bae3cd9
6
+ metadata.gz: 02aa2a81d5cd8fa7f1a3786eca77af2fdbb3d4be02ac1333657380621cefa275cac2b24e9121dd93e7253205a4068fb7966240c8d47179149f752776eaa37680
7
+ data.tar.gz: aca79768b2dccf7d1ab8730e46ef371f5379bd8b72a0b72bb24a1ab813d92b4f85e14c4a0fa0d1c1bb5854c46562a7ca1ba38e714449697dd954da835324aa3d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- portmone (0.0.4)
4
+ portmone (0.0.5)
5
5
  activesupport
6
6
  faraday (~> 0.9)
7
7
  money (~> 6.0)
@@ -55,23 +55,31 @@ class Portmone::Responses::OrderStatus < Portmone::Responses::BaseResponse
55
55
 
56
56
  def transactions
57
57
  @transactions ||= begin
58
- data.map do |h|
59
- Portmone::Transaction.new(h.merge(timezone: @timezone, currency: @currency))
58
+ if data
59
+ data.map do |h|
60
+ Portmone::Transaction.new(h.merge(timezone: @timezone, currency: @currency))
61
+ end
62
+ else
63
+ []
60
64
  end
61
65
  end
62
66
  end
63
67
 
64
68
  def order
65
69
  @order ||= begin
66
- data.any? && Portmone::Transaction.new(data.first.merge(data.last).merge(timezone: @timezone, currency: @currency))
70
+ if data
71
+ Portmone::Transaction.new(data.first.merge(data.last).merge(timezone: @timezone, currency: @currency))
72
+ else
73
+ Portmone::Transaction.new({})
74
+ end
67
75
  end
68
76
  end
69
77
 
70
78
  private
71
79
 
72
80
  def data
73
- data = @xml_data.dig('portmoneresult', 'orders', 'order') || @xml_data.dig('portmoneresult', 'order') || {}
74
- data = [data] unless data.is_a?(Array) # cannot use Array() on Hash
81
+ data = @xml_data.dig('portmoneresult', 'orders', 'order') || @xml_data.dig('portmoneresult', 'order')
82
+ data = [data] if data.is_a?(Hash) # cannot use Array() on Hash
75
83
  data
76
84
  end
77
85
  end
@@ -1,3 +1,3 @@
1
1
  module Portmone
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portmone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Sviridov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-04 00:00:00.000000000 Z
11
+ date: 2018-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport