Sha256: 004789e23644cbfaacb92d6d47361149942340ac41f00595d4561bc3ae515619

Contents?: true

Size: 1.13 KB

Versions: 11

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

#  here is how to setup a hierarchy within atome using a more simple way than fasten 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 'fasten' properties. So, if you enter:


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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
atome-0.5.7.6.0 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.5.9 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.5.4 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.5.3 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.5.1 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.4.8 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.4.7 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.4.6 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.4.3 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.4.2 vendor/assets/application/examples/hierarchy.rb
atome-0.5.7.3.9 vendor/assets/application/examples/hierarchy.rb