ruby-identitas-api 0.3.0 → 0.4.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: 41f57c2d6b42d84fe2986fedea63b449e388cac5
4
- data.tar.gz: abed4c9a310110fc1d32dc5fcd218f833bdf3a1c
3
+ metadata.gz: 52b5d497b207f2c9f3ebdf44858a923d097d1280
4
+ data.tar.gz: b8a458d56f15e8a51b8b2d55a7fa788ebbad975a
5
5
  SHA512:
6
- metadata.gz: 3b4617dba0806a3d86de99ec064ad977a008d0fb1103c707d2c8c443a414ef7c7a07d2bbf44c43281970e9e634a4430178267f09713deea81ac241cfee3dea43
7
- data.tar.gz: 3df75bf6cc1efc0c5c4c91630d68593b1ade0a6bf78c7078a2282124c360ceaa7a7a951d7a8f1f259557594fc04fbbc98edeb988c74402a9d50e769c1faa759f
6
+ metadata.gz: adec8a00e6c8c812428bdbcdaf901c4686cafb6a74059baa7e6613617a4f889556de736c04283e957736dcea50a965ce52e1911177a5df0d3219da06dc86c366
7
+ data.tar.gz: '0028420f47647fc756d0f497277a4959e31ef95220144656ed2dc16a043850723efc423da07f7bec1b27369e4428fd08b37ad7e9d89b06b296b50077ed561a78'
data/README.md CHANGED
@@ -67,7 +67,7 @@ example :
67
67
  response = request.token_status.parsed_response
68
68
  ```
69
69
 
70
- ### Chane password
70
+ ### Change password
71
71
 
72
72
  Change password
73
73
 
@@ -85,6 +85,27 @@ example :
85
85
  response = request.password({password: "mys3cret", password_confirmation: "mys3cret"}).parsed_response
86
86
  ```
87
87
 
88
+ ### Create user
89
+
90
+ Create a new user
91
+
92
+ parameters :
93
+
94
+ | name | type |
95
+ | ------------ | ------------ |
96
+ |`access_token`| query string |
97
+ |`email`| query string |
98
+ |`first_name`| query string |
99
+ |`last_name`| query string |
100
+ |`password`| query string |
101
+ |`password_confirmation`| query string |
102
+
103
+ example :
104
+
105
+ ```ruby
106
+ response = request.create_user({email: "m.yunan.helmy@gmail.com", first_name: "Yunan", last_name: "Helmy", password: "mys3cret", password_confirmation: "mys3cret"}).parsed_response
107
+ ```
108
+
88
109
  ## Development
89
110
 
90
111
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,7 +1,7 @@
1
1
  module Ruby
2
2
  module Identitas
3
3
  module Api
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,13 @@
1
+ module Ruby
2
+ module Identitas
3
+ module Endpoints
4
+ module User
5
+ def create_user(options = {})
6
+ options.merge!({access_token: @token})
7
+ endpoint = build_endpoint("/v1/users")
8
+ self.class.post(endpoint, query: options)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,6 +1,7 @@
1
1
  require "ruby/identitas/endpoints/me"
2
2
  require "ruby/identitas/endpoints/token_status"
3
3
  require "ruby/identitas/endpoints/password"
4
+ require "ruby/identitas/endpoints/user"
4
5
 
5
6
  module Ruby
6
7
  module Identitas
@@ -9,6 +10,7 @@ module Ruby
9
10
  include Ruby::Identitas::Endpoints::Me
10
11
  include Ruby::Identitas::Endpoints::TokenStatus
11
12
  include Ruby::Identitas::Endpoints::Password
13
+ include Ruby::Identitas::Endpoints::User
12
14
 
13
15
  def initialize(token)
14
16
  @base_uri = Ruby::Identitas::Api.url
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-identitas-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yunanhelmy
@@ -92,6 +92,7 @@ files:
92
92
  - lib/ruby/identitas/endpoints/me.rb
93
93
  - lib/ruby/identitas/endpoints/password.rb
94
94
  - lib/ruby/identitas/endpoints/token_status.rb
95
+ - lib/ruby/identitas/endpoints/user.rb
95
96
  - lib/ruby/identitas/main.rb
96
97
  - ruby-identitas-api.gemspec
97
98
  - spec/dummy/.gitignore