rsence-pre 2.1.0.12 → 2.1.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0.12.pre
1
+ 2.1.0.13.pre
@@ -192,14 +192,17 @@ module RSence
192
192
  # Uses the first name registered for the plugin and converts it to a symbol.
193
193
  #
194
194
  # @param [Message] msg The message is supplied by the system.
195
+ # @param [Symbol] key (optional) returns a ses key, if defined.
195
196
  #
196
197
  # @return [Hash] Plugin-specific session hash
197
- def get_ses( msg )
198
+ def get_ses( msg, key=false )
198
199
  name_sym = name_with_manager_s.to_sym
199
200
  unless msg.session.has_key?( name_sym )
200
201
  msg.session[ name_sym ] = {}
201
202
  end
202
- return msg.session[ name_sym ]
203
+ ses = msg.session[ name_sym ]
204
+ return ses[key] if key
205
+ return ses
203
206
  end
204
207
 
205
208
  # Returns the source code of the javascript file +js_name+ in the 'js' subdirectory of the plugin bundle. Use it to send raw javascript command code to the client. Use {#read_js_once} for libraries.
data/lib/values/hvalue.rb CHANGED
@@ -222,6 +222,25 @@ module RSence
222
222
  end
223
223
  end
224
224
 
225
+ # Sets the key of the hash data of the value, the change will be synced with the client.
226
+ # @param [Message] msg The {Message} instance.
227
+ # @param [String] key The key of data to change
228
+ # @param [#to_json] data Any data that can be mapped to JSON and handled by the client.
229
+ # @param [Boolean] dont_tell_client Doesn't notify the client about the change, if true.
230
+ def set_key( msg, key, data, dont_tell_client=false )
231
+
232
+ @data[key] = data
233
+
234
+ # won't tell the client about the change, usually not needed
235
+ unless dont_tell_client
236
+ ## update the flags
237
+ @sync = false
238
+ @is_valid = true
239
+
240
+ add_to_sync( msg )
241
+ end
242
+ end
243
+
225
244
  # @private Tell the client that the value changed.
226
245
  def to_client( msg )
227
246
  if @is_new_to_client
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- hash: 127
4
+ hash: 125
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
9
  - 0
10
- - 12
11
- version: 2.1.0.12
10
+ - 13
11
+ version: 2.1.0.13
12
12
  platform: ruby
13
13
  authors:
14
14
  - Riassence Inc.
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-27 00:00:00 +03:00
19
+ date: 2010-11-12 00:00:00 +02:00
20
20
  default_executable: rsence-pre
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency