lib/arcade/base.rb
# this has to be implemented on class level
# otherwise it interfere  with attributes
this has to be implemented on class level
otherwise it interfere  with attributes
this has to be implemented on class level otherwise it interfere with attributes
def create_type
        parent_present = ->(cl){ db.hierarchy.flatten.include? cl }
        e = ancestors.each
        myselfclass = e.next  
        superclass = the_class  = e.next
        loop do
          if ['Document','Vertex', 'Edge'].include? the_class.demodulize
            if  the_class == superclass  
              db.create_type the_class.demodulize, to_s.snake_case
            else
              extended = superclass.to_s.snake_case
              if !parent_present[extended]
                superclass.create_type
              end
              db.create_type the_class.demodulize, to_s.snake_case, extends:  extended
            end
            break  
          end
          the_class = e.next  
        end
        custom_setup = db_init rescue ""
        custom_setup.each_line do |  command |
          the_command =  command[0 .. -2]  
          next if the_command == ''
          db.execute { the_command }
        end unless custom_setup.nil?
      end
def create_type parent_present = -> ( cl ) { db . hierarchy . flatten . include? cl } e = ancestors . each myselfclass = e . next superclass = the_class = e . next loop do if [ 'Document' , 'Vertex' , 'Edge' ] . include? the_class . demodulize if the_class == superclass db . create_type the_class . demodulize , to_s . snake_case else extended = superclass . to_s . snake_case if ! parent_present [ extended ] superclass . create_type end db . create_type the_class . demodulize , to_s . snake_case , extends : extended end break end the_class = e . next end custom_setup = db_init rescue "" custom_setup . each_line do | command | the_command = command [ 0 .. - 2 ] next if the_command == '' db . execute { the_command } end unless custom_setup . nil? end
this has to be implemented on class level
otherwise it interfere  with attributes
this has to be implemented on class level otherwise it interfere with attributes
# start with the actual class(self) # no inheritance ## we have to use demodulise as the_class actually is Arcade::Vertex, ... # stop iteration # iterate through the enumerator # todo # include `created`` and `updated` properties to the aradedb-database schema if timestamps are set # (it works without declaring them explicitly, its thus omitted for now ) # Integration is easy: just execute two commands #  remove '\n' #  db.logger.info "Custom Setup:: #{the_command}"