cwallet-ruby 0.0.4 → 0.0.5

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: 631230e5029d5f39b01149cb8e9674ea0bcb926c
4
- data.tar.gz: d37dd34dcb495127201f1d6e01c90a647f1c3d68
3
+ metadata.gz: 39d77803f645c04503f8189409693a53751a7a5c
4
+ data.tar.gz: b95c8a59c856d1acc0d546460cebfa2db6f8d175
5
5
  SHA512:
6
- metadata.gz: 7e078cdf754fd492abe9a6713e49dd990d65c365d58d6cc72c26c6bfcb148cccd633be272a653784e439ed5ecfb5ab5562b639aa85c3e892e9275262f6f62446
7
- data.tar.gz: 1d3199acb24718456245326c09add6694452d821f691950a9509b95f273847d765129d26ad2a9a327b8baa0fb03fb2f9cbe91d1615d2d958a971a792c346855d
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|
@@ -1,6 +1,6 @@
1
1
  module Cwallet
2
2
  module Wallet
3
- BASE_API_URL = 'https://stg-wallet.fiahub.com'.freeze
3
+ BASE_API_URL = 'https://stg-wallet-api.fiahub.com'.freeze
4
4
  API_VERSION = '2018-10-10'.freeze
5
5
 
6
6
  class Client < NetHTTPClient
@@ -0,0 +1,6 @@
1
+ module Cwallet
2
+ module Wallet
3
+ class User < APIObject
4
+ end
5
+ end
6
+ end
@@ -1,5 +1,5 @@
1
1
  module Cwallet
2
2
  module Wallet
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -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
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-10-11 00:00:00.000000000 Z
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: