lib/atome/helpers/utilities.rb in atome-0.5.3.8.0 vs lib/atome/helpers/utilities.rb in atome-0.5.3.8.1
- old
+ new
@@ -4,11 +4,10 @@
class Atome
private
def collapse
@atome.each do |element, value|
- # puts "=============> #{element}"
send(element, value) unless element == :type
end
end
def security_pass(_element, _value)
@@ -87,12 +86,17 @@
def add_to_array(particle, value, &_user_proc)
# we update the holder of any new particle if user pass a bloc
@atome[particle] << value
end
+ def add_to_atome(atome_found, particle_found, &user_proc)
+ puts "we add : #{particle_found} to #{send(atome_found)} "
+ send(atome_found,particle_found,:adder, &user_proc)
+ end
+
def add(particles, &user_proc)
particles.each do |particle, value|
- particle_type = Universe.particle_list[particle]
+ particle_type = Universe.particle_list[particle] || 'atome'
send("add_to_#{particle_type}", particle, value, &user_proc)
end
end
def refresh