syncano 3.1.1.beta4 → 3.1.1.beta5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b75edf5f1aad772e7227d8ca59887d525e598cdb
4
- data.tar.gz: 12605d8d994a1af479fbc2c6acf5b789120c1220
3
+ metadata.gz: de0d4d181523b5d081bcfffad1a726be2a515cf3
4
+ data.tar.gz: 7bf73f1a965e8d7ad82c97dc43fa1b3e41fe3f7a
5
5
  SHA512:
6
- metadata.gz: 5800139bcb19838db014acb5fe4461930ccf52cb9b4de7223ada5bb60da78097402d3277965c0d24a143442c6745c851f7a3dc5bd695e163cfc6fffdd98b4cd7
7
- data.tar.gz: fbb8fc5451242f2e6e2603abaf691448b11867fe81a411b949d4c6b6e5005ae1a436d0002ef83e8bfdc755a1bc8fea0ad02bdc1d91fe1c242544d6816da18a8d
6
+ metadata.gz: ca1c6352decade66e64eecf110f83d9de1ff852c263468c233ce98acd1b74cc9f02deafef4091ee7579823d795fe37d49959cf897576d86048e03f23d3da929f
7
+ data.tar.gz: 542c9ecbb11261a19e8d49b7c17b81b281c929eafa2e4b28fa00aaaea57a4154c2f9518c8bcd12b2deb1283db56b7cfb2ab46ecbf9019721199cc9d0b12caac8
data/README.md CHANGED
@@ -10,7 +10,7 @@ Click here to learn more about [Syncano](http://www.syncano.com) or [create an a
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem 'syncano', '~> 3.1.1.beta4'
13
+ gem 'syncano', '~> 3.1.1.beta5'
14
14
 
15
15
  And then execute:
16
16
 
@@ -18,7 +18,7 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install syncano -v 3.1.1.beta4 --pre
21
+ $ gem install syncano -v 3.1.1.beta5 --pre
22
22
 
23
23
  At the end generate initializer with api key and api instance name:
24
24
 
@@ -311,6 +311,26 @@ To delete callback from the queue just call remove_callback method:
311
311
  client.remove_callback(:callback_name)
312
312
  ```
313
313
 
314
+ To list notifications ie. after connection use all method:
315
+
316
+ ```ruby
317
+ client.notifications.all
318
+ ```
319
+
320
+ #### Sending notifications
321
+
322
+ To send notification just create new notification object:
323
+
324
+ ```ruby
325
+ client.notifications.create(key: 'value')
326
+ ```
327
+
328
+ You can also pass additional attributes specified for api 'notification.send' method:
329
+
330
+ ```ruby
331
+ client.notifications.create(key: 'value', api_client_id: 512)
332
+ ```
333
+
314
334
  ### Errors and exceptions
315
335
 
316
336
  This library does not implement any validations. All errors from the api will cause throwing an exception.
@@ -41,6 +41,8 @@ class Syncano
41
41
  hostname = 'api.syncano.com'
42
42
  port = 8200
43
43
 
44
+ sleep(3)
45
+
44
46
  Thread.new do
45
47
  begin
46
48
  EM.run do
@@ -128,8 +128,11 @@ class Syncano
128
128
  response = perform_save(nil)
129
129
 
130
130
  if new_record?
131
- self.id = response.id
132
- self.attributes = response.attributes
131
+ response_data = ActiveSupport::HashWithIndifferentAccess.new(response.data)
132
+ created_object = self.class.new(client, self.class.map_to_scope_parameters(attributes).merge(response_data))
133
+
134
+ self.id = created_object.id
135
+ self.attributes.merge!(created_object.attributes)
133
136
  mark_as_saved!
134
137
  end
135
138
 
@@ -1,4 +1,4 @@
1
1
  class Syncano
2
2
  # Syncano version number
3
- VERSION = '3.1.1.beta4'
3
+ VERSION = '3.1.1.beta5'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syncano
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1.beta4
4
+ version: 3.1.1.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Zadrożny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-09 00:00:00.000000000 Z
11
+ date: 2014-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jimson-client