lib/atome/genesis/particles/utility.rb in atome-0.5.7.3.1 vs lib/atome/genesis/particles/utility.rb in atome-0.5.7.3.2

- old
+ new

@@ -1,12 +1,34 @@ # frozen_string_literal: true new({ particle: :renderers, category: :utility, type: :string }) -new({ particle: :code, category: :utility, type: :string }) -new({ particle: :run, category: :utility, type: :boolean }) do |params| - code_found = @code - instance_exec(params, &code_found) if code_found.is_a?(Proc) +new({ particle: :code, category: :utility, type: :string, store: false }) do |params, code| + @code[params]=code end +# new({ particle: :run, category: :utility, type: :boolean }) do |params| +# code_found = @code +# instance_exec(params, &code_found) if code_found.is_a?(Proc) +# end + +new({ particle: :run }) do |params, code| + instance_exec(&params) if params.is_a?(Proc) + code_found = @code[params] + instance_exec(params, &code_found) if code_found.is_a?(Proc) +end + +new({ particle: :target }) do |params| + params.each do |atome_f, value_f| + if value_f.instance_of?(Hash) + value_f.each do |part_f, part_val| + grab(atome_f).send(part_f, part_val) + end + else + grab(atome_f).send(value_f) + end + end +end + + # new({ particle: :broadcast }) def delete_recursive(atome_id, force=false) return if grab(atome_id).tag && (grab(atome_id).tag[:persistent] || grab(atome_id).tag[:system]) unless force