zquickblox 0.1.8 → 0.1.9

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: aeb0858b298f6e9d67fd7ddfcbfabefe0fcf37ac
4
- data.tar.gz: 999be6edda770efcd280412f2ad5ffad0ae78660
3
+ metadata.gz: 2ff41a6dbca65c15a90c93db9924966e331558e2
4
+ data.tar.gz: ae79a98bbc334f6bc48fc80e0d98e72a85d97561
5
5
  SHA512:
6
- metadata.gz: 7158981235e439d4396e7eeaab26c0a61d4e6a4ed4875916559f65e0f4219c43e912cc0cf51f76087d443fdb06e6af23b2fd3bae31ab6e311a46558365f0ef1e
7
- data.tar.gz: 2fc11880467f73dada1a66d660882e3818d34fa5158c6cfec781cd8c57823fc8dd55575d500cef8895d396431551e1c9967286a7468611914df01581a1cf6cbe
6
+ metadata.gz: b216ef31fa8102fa654818b56d338e5a1afd4e1f0cd426c11ffd8e23b6ac7bbecedf4de1b8be694e1ea002c98f65cdabfd57747c573c2d678d91e09e2a4e166d
7
+ data.tar.gz: 1a1c6d15a2086314efba5b8a3f1ea04d5160885fc55afaab65b5db62290b7916ab83d29d396eff65d1cec45e7a8f50274b8ccc884d920d996675bfd6b01d33a7
@@ -0,0 +1,12 @@
1
+ module ZQuickblox
2
+ module Dialog
3
+ class GetDialogsRequest < Request
4
+ def initialize(params)
5
+ super()
6
+ params = params.map { |key, value| "#{key}=#{value}" }.join("&")
7
+ @uri = "/chat/Dialog.json?#{params}"
8
+ @method = :get
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,9 +1,18 @@
1
1
  require_relative "dialog/create_dialog_request"
2
2
  require_relative "dialog/update_dialog_request"
3
+ require_relative "dialog/get_dialogs_request"
3
4
 
4
5
  module ZQuickblox
5
6
  module Dialog
6
7
  class << self
8
+ def get(login, password, params)
9
+ request = ZQuickblox::Dialog::GetDialogsRequest.new(params)
10
+ run_request(login, password, request)
11
+ response = ZQuickblox::Util.symbolize_keys(request.response_body)
12
+ dialogs = response[:items].map { |item| Dialog.new(item) }
13
+ return dialogs
14
+ end
15
+
7
16
  def create(login, password, params)
8
17
  dialog = Dialog.new(params)
9
18
  params = dialog.build_params
@@ -1,3 +1,3 @@
1
1
  module ZQuickblox
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
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.8
4
+ version: 0.1.9
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-11-16 00:00:00.000000000 Z
11
+ date: 2016-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -102,6 +102,7 @@ files:
102
102
  - lib/zquickblox.rb
103
103
  - lib/zquickblox/dialog.rb
104
104
  - lib/zquickblox/dialog/create_dialog_request.rb
105
+ - lib/zquickblox/dialog/get_dialogs_request.rb
105
106
  - lib/zquickblox/dialog/update_dialog_request.rb
106
107
  - lib/zquickblox/error.rb
107
108
  - lib/zquickblox/request.rb