lib/atome/genesis/genesis.rb in atome-0.5.3.8.8 vs lib/atome/genesis/genesis.rb in atome-0.5.4.0.9
- old
+ new
@@ -20,20 +20,27 @@
render = true if options[:render].nil?
# we add the new method to the particle's collection of methods
Universe.add_to_particle_list(particle_name, type)
# the line below create an empty particle method for each renderer, eg: browser_left, headless_width, ...
+ # the line below create the corresponding particle method for Batch class
+ particle_method_for_batch(particle_name)
auto_render_generator(particle_name) if render
new_particle(particle_name, store, render, &particle_proc)
# the line below create all alternatives methods such as create 'method='
additional_particle_methods(particle_name, store, render, &particle_proc)
end
def build_atome(atome_name, &atome_proc)
# TODO : atomes should tell the Universe if they're parts of materials category or else
# we add the new method to the atome's collection of methods
Universe.add_to_atome_list(atome_name)
+ # the method below generate Atome method creation at Object level,
+ # so a syntax like : 'text(:hello)' is possible instead of the mandatory : grab(:view).text(:hello)
+ atome_method_for_object(atome_name)
+ # the line below create the corresponding atome method for Batch class
+ atome_method_for_batch(atome_name)
unless Essentials.default_params[atome_name]
# if it doesn't exist
# we create default params for the new created atome, adding the hash to : module essential, @default_params
Essentials.new_default_params(atome_name => { type: atome_name, attach: [:view] })
end
@@ -58,8 +65,9 @@
def build_sanitizer(method_name, &method_proc)
Universe.add_sanitizer_method(method_name.to_sym, &method_proc)
end
def build_option(method_name, &method_proc)
+ #puts "2 => #{method_name}"
Universe.add_optional_method(method_name.to_sym, &method_proc)
end
end