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 +4 -4
- data/README.md +10 -0
- data/lib/monzo.rb +1 -0
- data/lib/monzo/pot.rb +37 -0
- data/lib/monzo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca691ae63f93ef6c1c6c601bd4b2e0d6f0f8c09
|
4
|
+
data.tar.gz: 407b2ff8fe2e498c9fe740af03a873186fc10b01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/lib/monzo.rb
CHANGED
data/lib/monzo/pot.rb
ADDED
@@ -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
|
data/lib/monzo/version.rb
CHANGED
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.
|
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-
|
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
|