octobat 2.0.4 → 2.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: 5747bf388972cd59177703b40d5b6131a06bd322
4
- data.tar.gz: 5ce860b623beff2db652e4c64a79cd5696ff0dd9
3
+ metadata.gz: 1f2b337085e5a7c550c638bc88b07445e52576e8
4
+ data.tar.gz: 9b41bfc9db546d892307f0845ec4b1a92b2269db
5
5
  SHA512:
6
- metadata.gz: 146ec6a8f21a62fc9d5032037e3572e9a49dae003c93629ef3839b77c1bcb56576476e82100fad9b7fb17dde588c124841f62102aa5dd2495f7dac9fe995cd78
7
- data.tar.gz: 0279683da36f1b01de5b1d65c8336aa91130589b47814fbfdc6645a7a061bed8cf28c4839b907e54d591f42f335b76fdfd21f6ffe913b36a9ea06b238165530b
6
+ metadata.gz: 120d7c943045b7ae6158d38dcd8ed608ae579c7071454b4145077d841343445c563a0beb12e45e2af0e85b11946b739851ad936af1e4b74b443217c03a71aa16
7
+ data.tar.gz: a95d0582cd30d4037d3b75fce4f366a1c95418982a744fdbd6b272aea418cdb639497a6eda465c68cfce601a55feb7a659f2f0d4d25e3d2a428376f52f8295c8
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 2.0.5 2017-05-29
2
+ * 1 minor enhancement:
3
+ * Balance transactions belong to payouts
4
+
1
5
  === 2.0.4 2017-05-26
2
6
  * 2 minor enhancement:
3
7
  * Manage different API versions
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.4
1
+ 2.0.5
@@ -1,5 +1,29 @@
1
1
  module Octobat
2
2
  class BalanceTransaction < APIResource
3
3
  extend Octobat::APIOperations::List
4
+
5
+ def url
6
+ puts parent_obj
7
+ !parent_obj.nil? ? parentize_url : super
8
+ end
9
+
10
+ def parentize_url
11
+ if parent_obj.include?(:payout)
12
+ "#{Payout.url}/#{CGI.escape(parent_obj[:payout])}/balance_transactions/#{CGI.escape(id)}"
13
+ else
14
+ url
15
+ end
16
+ end
17
+
18
+ def self.url
19
+ if @parent_resource.include?(:payout)
20
+ "#{Payout.url}/#{CGI.escape(@parent_resource[:payout])}/balance_transactions"
21
+ end
22
+ end
23
+
24
+ def self.set_parent_resource(filters)
25
+ @parent_resource = filters.select{|k, v| [:payout].include?(k)}
26
+ end
27
+
4
28
  end
5
29
  end
@@ -1,5 +1,9 @@
1
1
  module Octobat
2
2
  class Payout < APIResource
3
3
  extend Octobat::APIOperations::List
4
+
5
+ def balance_transactions(params = {})
6
+ BalanceTransaction.list(params.merge({ payout: id }), @api_key)
7
+ end
4
8
  end
5
9
  end
@@ -1,3 +1,3 @@
1
1
  module Octobat
2
- VERSION = '2.0.4'
2
+ VERSION = '2.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octobat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaultier Laperche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-26 00:00:00.000000000 Z
11
+ date: 2017-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -84,7 +84,6 @@ files:
84
84
  - lib/octobat/item.rb
85
85
  - lib/octobat/list_object.rb
86
86
  - lib/octobat/octobat_object.rb
87
- - lib/octobat/payment.rb
88
87
  - lib/octobat/payment_recipient.rb
89
88
  - lib/octobat/payment_recipient_reference.rb
90
89
  - lib/octobat/payment_source.rb
@@ -1,4 +0,0 @@
1
- module Octobat
2
- class Payment < APIResource
3
- end
4
- end