monzo 0.1.0 → 0.2.0

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: 1d7a10b8bf9ee4689cb437e878d0746ffef7cb2f
4
- data.tar.gz: d07b17c677bda9e8a3256b2be84956593e2513bb
3
+ metadata.gz: bca691ae63f93ef6c1c6c601bd4b2e0d6f0f8c09
4
+ data.tar.gz: 407b2ff8fe2e498c9fe740af03a873186fc10b01
5
5
  SHA512:
6
- metadata.gz: 8be1dd299af506ab18024f295cc850a2cc025eb1a99baa69e0ae911a4b03c468cfa639a90f81cd954273fcd76232d386effa9bae7212fe99132c926d132a2cd7
7
- data.tar.gz: b9eb8212fb0a695091712b73d2b3758e8b41e848b6da453113e13e1ffb4002528eae17695ac91517f9109cf74ca51ababf0e09918b2dae6f6c64c3fc46788501
6
+ metadata.gz: be97766eedfd044f591ace66749efaafe95725eab79317282b786644b866e948e59a987aa2768a3798b3c8f475e16eb0af6dc5fa6b2d7b00cfea92bacaee5186
7
+ data.tar.gz: bea7bd7cf6b42d19a8c0140f64d80ba734de11354f01b8066cd15ceeff41e9ddb14713930791e2d7637f7e3f088b7b557132ca63d878b26d7281d1856534b2ba
data/README.md CHANGED
@@ -55,6 +55,16 @@ Accounts represent a store of funds, and have a list of transactions. [Docs](htt
55
55
  Monzo::Account.all
56
56
  ```
57
57
 
58
+ ### Pots
59
+
60
+ A Pot is a place to keep some money separate from your main spending account.
61
+ [Docs](https://monzo.com/docs/#pots)
62
+
63
+ ```ruby
64
+ # Find all Monzo Pots
65
+ Monzo::Pot.all
66
+ ```
67
+
58
68
  ### Balance
59
69
 
60
70
  Retrieve information about an account’s balance. [Docs](https://monzo.com/docs/#balance)
@@ -5,6 +5,7 @@ require "monzo/account"
5
5
  require "monzo/balance"
6
6
  require "monzo/transaction"
7
7
  require "monzo/feed_item"
8
+ require "monzo/pot"
8
9
  require "monzo/webhook"
9
10
  require "monzo/client"
10
11
  require "monzo/configuration"
@@ -0,0 +1,37 @@
1
+ module Monzo
2
+
3
+ # Public: Retrieve information about a pot. A Pot is a place to keep
4
+ # some money separate from your main spending account.
5
+ class Pot
6
+
7
+ attr_reader :id, :name, :style, :balance,
8
+ :currency, :created, :updated, :deleted
9
+
10
+ # Public: Initialize an Pot.
11
+ #
12
+ # params - A Hash of pot parameters.
13
+ def initialize(params)
14
+ @id = params[:id]
15
+ @name = params[:name]
16
+ @style = params[:style]
17
+ @balance = params[:balance]
18
+ @currency = params[:currency]
19
+ @created = params[:created]
20
+ @updated = params[:updated]
21
+ @deleted = params[:deleted]
22
+ end
23
+
24
+ # Public: Find all Monzo Pots
25
+ #
26
+ # Returns An Array of Monzo::Pot
27
+ def self.all
28
+ client = Monzo.client
29
+ response = client.get("/pots/listV1")
30
+ parsed_response = JSON.parse(response.body, :symbolize_names => true)
31
+
32
+ parsed_response[:pots].map do |item|
33
+ Monzo::Pot.new(item)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,4 +1,4 @@
1
1
  module Monzo
2
2
  # Public: The version number of the gem.
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monzo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Murray Summers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-07 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,6 +118,7 @@ files:
118
118
  - lib/monzo/client.rb
119
119
  - lib/monzo/configuration.rb
120
120
  - lib/monzo/feed_item.rb
121
+ - lib/monzo/pot.rb
121
122
  - lib/monzo/transaction.rb
122
123
  - lib/monzo/version.rb
123
124
  - lib/monzo/webhook.rb