zquickblox 0.1.3 → 0.1.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: e32eabb77c69c0a2975f9bba70a3334f3863dd1e
4
- data.tar.gz: 4d36f08c338b3efac343ff58c1bc5b9aa3c96f66
3
+ metadata.gz: f8504cbc6edd677249804261a809d424f4e34d64
4
+ data.tar.gz: f6f6473eee8da00b508b24d6c84e507ade0ee483
5
5
  SHA512:
6
- metadata.gz: 07ac40644c86a58cb914718b2d9a60c9ce8fbd447453c1e57ca830d916c82213f0fc2abc11563a642f8198ffccaecb4f4bda07e10aa951007093d3432f7a47f9
7
- data.tar.gz: 5d14ef46076d89b94ffcbfb20f886090e5e10ed1581caaa08fe5da49098ae65686c4db12883aa531a3525ec608f7e65f94b51873ba4aa3efa98c4c006061e209
6
+ metadata.gz: 7621e3d66779f8448ecdd1188e5d968e649894d17ac69c4510e54ce4f49db078e9c3d0a9730116a531f327fcf32f3a32420a9c6cabfe93c79fb08d18c8d9207d
7
+ data.tar.gz: 91243d9e0d41ad9903e58cf7a948488d671e1fedecf215596c1abb92e54cb42511b18dbb6e211ab5604d9add7456ec67e81d23c83472870fb8cac9fa4a89fc5f
data/README.md CHANGED
@@ -36,8 +36,8 @@ You need to config your Quickblox as below:
36
36
 
37
37
  ```ruby
38
38
  ZQuickblox.configure do |config|
39
- config.app_id = ENV['QB_APP_ID'],
40
- config.auth_key = ENV['QB_AUTH_KEY'],
39
+ config.app_id = ENV['QB_APP_ID']
40
+ config.auth_key = ENV['QB_AUTH_KEY']
41
41
  config.auth_secret = ENV['QB_AUTH_SECRET']
42
42
  end
43
43
  ```
@@ -0,0 +1,12 @@
1
+ module ZQuickblox
2
+ module User
3
+ class FindUserRequest < Request
4
+ def initialize(login)
5
+ super()
6
+ @uri = "/users/by_login.json?login=#{login}"
7
+ @method = :get
8
+ @params = params
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,5 @@
1
1
  require_relative "user/create_user_request"
2
+ require_relative "user/find_user_request"
2
3
 
3
4
  module ZQuickblox
4
5
  module User
@@ -12,6 +13,13 @@ module ZQuickblox
12
13
  return user
13
14
  end
14
15
 
16
+ def find(login)
17
+ request = ZQuickblox::User::FindUserRequest.new(login)
18
+ run_request(request)
19
+ return true if request.response.status == 200
20
+ return false
21
+ end
22
+
15
23
  def run_request(request)
16
24
  session = ZQuickblox::Session.create
17
25
  request.header("QB-Token", session.token)
@@ -1,3 +1,3 @@
1
1
  module ZQuickblox
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zquickblox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thuong Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-25 00:00:00.000000000 Z
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,6 +105,7 @@ files:
105
105
  - lib/zquickblox/signature.rb
106
106
  - lib/zquickblox/user.rb
107
107
  - lib/zquickblox/user/create_user_request.rb
108
+ - lib/zquickblox/user/find_user_request.rb
108
109
  - lib/zquickblox/util.rb
109
110
  - lib/zquickblox/version.rb
110
111
  - zquickblox.gemspec
@@ -134,4 +135,3 @@ signing_key:
134
135
  specification_version: 4
135
136
  summary: A good friend of Quickblox.
136
137
  test_files: []
137
- has_rdoc: