cwallet-ruby 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 +4 -4
- data/lib/cwallet/wallet/api_client.rb +16 -0
- data/lib/cwallet/wallet/client.rb +1 -1
- data/lib/cwallet/wallet/models/user.rb +6 -0
- data/lib/cwallet/wallet/version.rb +1 -1
- data/lib/cwallet/wallet.rb +1 -0
- 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: 39d77803f645c04503f8189409693a53751a7a5c
|
4
|
+
data.tar.gz: b95c8a59c856d1acc0d546460cebfa2db6f8d175
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d36bd44000c936f12b9c8a97fc5e64d6a5ff06c0dd5492e8734b9fd027cd6c32e4a70fbc8e0275cada4b146fc45c40b60bab6df014a7fba87d2b6656be16245
|
7
|
+
data.tar.gz: 45b73119310de01b54da0a3a07407dd1a1170c700c0a83f64060cdef75d3a08c7a141865e9d80936767c85565d15acebfeaaee659a80e21c4ecfec8ac8709b03
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pry'
|
2
|
+
|
1
3
|
module Cwallet
|
2
4
|
module Wallet
|
3
5
|
class APIClient
|
@@ -80,6 +82,20 @@ module Cwallet
|
|
80
82
|
#
|
81
83
|
# Users
|
82
84
|
#
|
85
|
+
def self.create_user(params)
|
86
|
+
req = Net::HTTP::Post.new("/v2/user")
|
87
|
+
req.body = params.to_json
|
88
|
+
req['Content-Type'] = 'application/json'
|
89
|
+
req['User-Agent'] = "cwallet/ruby/#{Cwallet::Wallet::VERSION}"
|
90
|
+
|
91
|
+
uri = URI.parse(Cwallet::Wallet::BASE_API_URL)
|
92
|
+
conn = Net::HTTP.new(uri.host, uri.port)
|
93
|
+
conn.use_ssl = true
|
94
|
+
resp = conn.request(req)
|
95
|
+
|
96
|
+
User.new(self, JSON.parse(resp.body)['data'])
|
97
|
+
end
|
98
|
+
|
83
99
|
def user(user_id, params = {})
|
84
100
|
out = nil
|
85
101
|
get("/v2/users/#{user_id}", params) do |resp|
|
data/lib/cwallet/wallet.rb
CHANGED
@@ -13,6 +13,7 @@ require 'cwallet/wallet/models/api_object'
|
|
13
13
|
require 'cwallet/wallet/models/account'
|
14
14
|
require 'cwallet/wallet/models/address'
|
15
15
|
require 'cwallet/wallet/models/transaction'
|
16
|
+
require 'cwallet/wallet/models/user'
|
16
17
|
require 'cwallet/wallet/client'
|
17
18
|
|
18
19
|
module Cwallet
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cwallet-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Duc Le
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- lib/cwallet/wallet/models/address.rb
|
98
98
|
- lib/cwallet/wallet/models/api_object.rb
|
99
99
|
- lib/cwallet/wallet/models/transaction.rb
|
100
|
+
- lib/cwallet/wallet/models/user.rb
|
100
101
|
- lib/cwallet/wallet/version.rb
|
101
102
|
homepage: https://www.ducle.me
|
102
103
|
licenses:
|