Sha256: ad3217852397824b82d84ef98ffd8c18d041bcb1b48f6da48689dec519976aad

Contents?: true

Size: 1.58 KB

Versions: 40

Compression:

Stored size: 1.58 KB

Contents

#  frozen_string_literal: true
b = box({ id: :the_box })
b.data(:canyouwritethis)
b.rotate(33)
b.rotate(88)
b.rotate(99)
b.rotate(12)
b.rotate(6)
b.data
b.touch(true) do
  b.data(:super)
  puts b.data
  # operation has two option write or read, it filter the history on those two options,  write retrieve all alteration
  # of the particle , read list everytime a particle was get
  # id retrieve all operation on a given ID
  # particle retrieve all operation on a given particle
end


# alert b.instance_variable_get('@history')
# box_rotate_history=b.history({ operation: :write, id: :the_box, particle: :rotate })
# puts "get all all rotate write operation :  #{box_rotate_history}"
# first_rotate_operation_state=b.history({ operation: :write, id: :the_box, particle: :rotate })[0][:sync]
#
# # we check if an operation synced (that means saved on atome's server)
# puts "first rotate operation state  :  #{box_rotate_history[0]}"
#
# # we check if an operation synced (that means saved on atome's server)
# puts "first rotate operation initial state  :  #{box_rotate_history[0]}"
# puts "synced  :  #{first_rotate_operation_state}"
# first_rotate_operation_number=b.history({ operation: :write, id: :the_box, particle: :rotate })[0][:operation]
# puts "first rotate 'write' operation number is:  #{first_rotate_operation_number}"

# now we sync the state
# Universe.synchronised(first_rotate_operation_number, :star_wars)
# now we check if it's synced
# box_rotate_history=b.history({ operation: :write, id: :the_box, particle: :rotate })
# puts "new state for first rotate operation : #{box_rotate_history[0]}"

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
atome-0.5.7.0.7 vendor/assets/application/examples/sync.rb
atome-0.5.7.0.5 vendor/assets/application/examples/sync.rb
atome-0.5.7.0.4 vendor/assets/application/examples/sync.rb
atome-0.5.7.0.3 vendor/assets/application/examples/sync.rb
atome-0.5.7.0.2 vendor/assets/application/examples/sync.rb
atome-0.5.6.8.7 vendor/assets/application/examples/sync.rb
atome-0.5.6.8.6 vendor/assets/application/examples/sync.rb
atome-0.5.6.8.5 vendor/assets/application/examples/sync.rb
atome-0.5.6.8.3 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.8 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.7 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.6 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.5 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.4 vendor/assets/application/examples/sync.rb
atome-0.5.6.7.3 vendor/assets/application/examples/sync.rb
atome-0.5.6.6.9 vendor/assets/application/examples/sync.rb
atome-0.5.6.6.7 vendor/assets/application/examples/sync.rb
atome-0.5.6.6.5 vendor/assets/application/examples/sync.rb
atome-0.5.6.6.1 vendor/assets/application/examples/sync.rb
atome-0.5.6.6.0 vendor/assets/application/examples/sync.rb