Sha256: 55a4a7477bb9ac4fe66ade125fb3ef90c7b8ce625517fb4d4133ffd206f3df9d

Contents?: true

Size: 1.15 KB

Versions: 72

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

#  here is how to setup a hierarchy within atome using a more simple way than attached and attach .simply adding atome inside another atome. here is a example to do to so : b = box({ id: :the_box })
b=box
# the line below will create a circle inside the box b
c = b.circle({ id: :the_circle })
# we can add any atome inside another atome, below we add a text inside de th box b
t = b.text({ data: :hello, left: 200, id: :the_cirle })
# theres no limit in the depht of atome, we can create an image inside the text, exemple:
t.image({ path: 'medias/images/logos/atome.svg', width: 33 })

# note that creating a hierarchy this way automatically

# Note that when you create a hierarchy in this way, it automatically creates a relationship by populating the 'attach' and 'attached' properties. So, if you enter:


puts "b attach : #{b.attach}" # prints [:view] in the console as it is attached to the view atom
puts "b attached :#{b.attached}" # prints [:the_circle, :the_cirle] in the console

puts "c attach: #{c.attach}" # prints [:the_box] in the console
puts "c attached: #{c.attached}" # prints [:box_14] in the console as there's no child

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
atome-0.5.7.3.6 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.5 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.3 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.2 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.1 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.0 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.1.8 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.1.7 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.1.0 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.0.7 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.0.5 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.0.4 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.0.3 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.0.2 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.8.7 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.8.6 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.8.5 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.8.3 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.7.8 vendor/assets/application/examples/hierarchy.rb
atome-0.5.6.7.7 vendor/assets/application/examples/hierarchy.rb