bunq_rb 0.1.3 → 0.1.4

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
  SHA1:
3
- metadata.gz: 133295d787cdcf0838252c61924829c8fc4b0d73
4
- data.tar.gz: 7d0e6914b7a9cdcb7557131e97e97f8a5c6d86c6
3
+ metadata.gz: ab9a776167ec4d36f03ac375420976fa1b1fb012
4
+ data.tar.gz: 40f0259693c41e0e93b4ce2ea7511b41d9bebee3
5
5
  SHA512:
6
- metadata.gz: 327f5eebe0a7b18f4db8015fdff5941a85c83c60e8db7583765ced12514e22132495aed5b6cae25da06b7be0510ea88f5603eb106e40a1605d448c77d39d5ac9
7
- data.tar.gz: 129ce7b54c376b1461d3fa62bf0a624947e14717df6b8ce8967be81349d3ad024af6ab34eda59fd4320829e05253710d6e642c7cf1ca9221dc6aff82905ad9ff
6
+ metadata.gz: a9f85b9c032ce8307f287e8d1281749b80d6a55ef9abf19cc7b076a0ee39aa88898f78ceabc405d0dedd146a8d1a39f5dc546fe37419751417b7e3c7370ba503
7
+ data.tar.gz: 2319c34257ebf6b57def73eaaa581357333665ed55f2b5c8b9ce7878f4bebd339975aad14a95f845628c1fee06135b0539e4c4d468c48614d88530c6197103c5
data/README.md CHANGED
@@ -954,15 +954,27 @@ TODO
954
954
 
955
955
  ##### GET
956
956
 
957
- TODO
957
+ ```ruby
958
+ user_id = 1
959
+ monetary_account_id = 11
960
+ invoice = BunqRb::CustomerStatementExport.find(user_id, monetary_account_id, 42)
961
+ ```
958
962
 
959
963
  ##### LIST
960
964
 
961
- TODO
965
+ ```ruby
966
+ user_id = 1
967
+ monetary_account_id = 11
968
+ invoices = BunqRb::CustomerStatementExport.all(user_id, monetary_account_id)
969
+ ```
962
970
 
963
971
  ##### DELETE
964
972
 
965
- TODO
973
+ ```ruby
974
+ user_id = 1
975
+ monetary_account_id = 11
976
+ invoice = BunqRb::CustomerStatementExport.delete(user_id, monetary_account_id, 42)
977
+ ```
966
978
 
967
979
  #### Customer Statement Export Content
968
980
 
@@ -978,11 +990,17 @@ TODO
978
990
 
979
991
  ##### GET
980
992
 
981
- TODO
993
+ ```ruby
994
+ user_id = 1
995
+ invoice = BunqRb::ExportAnnualOverview.find(user_id, 42)
996
+ ```
982
997
 
983
998
  ##### LIST
984
999
 
985
- TODO
1000
+ ```ruby
1001
+ user_id = 1
1002
+ invoices = BunqRb::ExportAnnualOverview.all(user_id)
1003
+ ```
986
1004
 
987
1005
  #### Export Annual Overview Content
988
1006
 
@@ -19,6 +19,8 @@ module BunqRb
19
19
  implements_get
20
20
  when :list
21
21
  implements_list
22
+ when :delete
23
+ implements_delete
22
24
  else
23
25
  puts "ERROR for: #{call}"
24
26
  end
@@ -27,6 +29,15 @@ module BunqRb
27
29
 
28
30
  private
29
31
 
32
+ def implements_delete
33
+ define_singleton_method(:delete) do |*args|
34
+ id = args.pop
35
+ full_uri = [url(*args), id].join("/")
36
+ response = Client.send_method(:delete, full_uri)
37
+ []
38
+ end
39
+ end
40
+
30
41
  def implements_get
31
42
  define_singleton_method(:find) do |*args|
32
43
  id = args.pop
@@ -0,0 +1,19 @@
1
+ module BunqRb
2
+ # CustomerStatementExport
3
+ class CustomerStatementExport
4
+ include BunqRb::Shared
5
+
6
+ implements :list, :get, :delete
7
+
8
+ attr_reader :id, :status
9
+
10
+ def initialize(hsh = {})
11
+ @id = hsh["id"]
12
+ @status = hsh["status"]
13
+ end
14
+
15
+ def self.url(user_id, monetary_account_id)
16
+ "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/customer-statement"
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ module BunqRb
2
+ # ExportAnnualOverview
3
+ class ExportAnnualOverview
4
+ include BunqRb::Shared
5
+
6
+ implements :list, :get
7
+
8
+ attr_reader :id, :year
9
+
10
+ def initialize(hsh = {})
11
+ @id = hsh["id"]
12
+ @year = hsh["year"]
13
+ end
14
+
15
+ def self.url(user_id)
16
+ "/v1/user/#{user_id}/export-annual-overview"
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module BunqRb
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunq_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-28 00:00:00.000000000 Z
12
+ date: 2018-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -114,8 +114,10 @@ files:
114
114
  - lib/bunq_rb/objects/card.rb
115
115
  - lib/bunq_rb/objects/card_name.rb
116
116
  - lib/bunq_rb/objects/cash_register.rb
117
+ - lib/bunq_rb/objects/customer_statement_export.rb
117
118
  - lib/bunq_rb/objects/device.rb
118
119
  - lib/bunq_rb/objects/device_server.rb
120
+ - lib/bunq_rb/objects/export_annual_overview.rb
119
121
  - lib/bunq_rb/objects/installation.rb
120
122
  - lib/bunq_rb/objects/installation_server_public_key.rb
121
123
  - lib/bunq_rb/objects/invoice.rb