lib/atome/helpers/essentials.rb in atome-0.5.3.8.1 vs lib/atome/helpers/essentials.rb in atome-0.5.3.8.8
- old
+ new
@@ -1,39 +1,42 @@
# frozen_string_literal: true
# use to sanitize and secure user input
module Essentials
@default_params = {
+ # Warning : type must be define first
render_engines: [:browser],
- collector: { type: :element, renderers: [], children: [], parents: [:black_matter] },
- animation: { type: :animation, children: [] , parents: [:black_matter]},
- element: { type: :element, renderers: [], children: [] , parents: [:black_matter]},
- matrix: { renderers: [], id: '', type: :shape, width: 99, height: 99,
- attached: [:matrix_color], children: [],
- left: 100, top: 100, clones: [], preset: :matrix, parents: [:view] },
- box: { renderers: [], id: '', type: :shape, width: 99, height: 99,
- attached: [:box_color], children: [], parents: [:view],
+ collector: { type: :element, attach: [:black_matter] },
+ image: { type: :image, attach: [:view] },
+ web: { type: :web, attach: [:view] },
+ video: { type: :video, attach: [:view] },
+ animation: { type: :animation, attach: [:black_matter] },
+ element: { type: :element, renderers: [], attach: [:black_matter] },
+ matrix: { type: :shape, width: 99, height: 99,
+ attached: :matrix_color,
+ left: 100, top: 100, clones: [], preset: :matrix, attach: [:view] },
+ box: { type: :shape, width: 99, height: 99,
+ attached: :box_color, attach: [:view],
left: 100, top: 100, clones: [], preset: :box },
- circle: { renderers: [], id: '', type: :shape, width: 99, height: 99, smooth: '100%',
- attached: [:circle_color], children: [], parents: [:view],
+ circle: { type: :shape, width: 99, height: 99, smooth: '100%',
+ attached: :circle_color, attach: [:view],
left: 100, top: 100, clones: [], preset: :circle },
- shape: { renderers: [], id: '', type: :shape, width: 99, height: 99,
- attached: [:shape_color], children: [], parents: [:view],
+ shape: { type: :shape, width: 99, height: 99,
+ attached: :shape_color, attach: [:view],
left: 100, top: 100, clones: [] },
- text: { renderers: [], id: '', type: :text, visual: { size: 25 },
- attached: [:text_color], children: [], parents: [:view],
+ text: { type: :text, visual: { size: 25 },
+ attached: :text_color, attach: [:view],
data: 'this is a text sample', width: 199, height: 33, clones: [] },
- drm: { type: :drm,parents: [:black_matter] },
- shadow: {parents: [:black_matter]},
- color: {parents: [:black_matter]}
+ drm: { type: :drm, attach: [:black_matter] },
+ shadow: { type: :shadow, attach: [:black_matter] },
+ color: { type: :color,attach: [:black_matter], red: 0, green: 0, blue: 0, alpha: 1 }
}
def self.default_params
@default_params
end
def self.new_default_params(new_default)
- # puts "=====+====> #{new_default}, #{new_default.class}"
@default_params.merge!(new_default)
end
def validation(atome_instance_var)
# TODO: write validation scheme