lib/atome/helpers/utilities.rb in atome-0.5.6.4.8 vs lib/atome/helpers/utilities.rb in atome-0.5.6.5.1
- old
+ new
@@ -5,10 +5,25 @@
class Atome
class << self
+ def sync(params, &bloc)
+ alert :server_sync
+ # params = { data: params } unless params.instance_of? Hash
+ # # params[:user] = 'dfghg4df5gdfgh654'
+ # # params[:pass] = 'gfhkzrhgzr4h98948'
+ # # instance_variable_set('@message_code', {}) unless instance_variable_get('@message_code')
+ # # store_proc= instance_variable_get('@message_code')
+ # message_id= "msg_#{Universe.messages.length}"
+ # params[:message_id]=message_id
+ # # store_proc[mmessage_id]=bloc
+ # Universe.store_messages({msg_nb:message_id, proc: bloc })
+ # html.send_message(params)
+
+ end
+
def file_handler(parent, content, bloc)
grab(parent).instance_exec(content, &bloc)
end
def controller_sender(message)
@@ -301,14 +316,19 @@
end
hash
end
def refresh
+ # we get the current color because they will be removed
+ # prev_color=color
+ # alert color.class
particles_found = to_hash
particles_found.each do |particle_found, value_found|
send(particle_found, value_found)
end
-
+ color.each do |col|
+ apply(col)
+ end
end
def each(&proc)
collect.each do |val|
instance_exec(val, &proc) if proc.is_a?(Proc)