def generate
      instance_eval(&callbacks[:setup])
      if options.only_recursion_depth.present?
        depth = options.only_recursion_depth.to_i
        options[:only].dup.each do |class_name|
          options[:only]+= recurse_into_relationships(@domain.entity_by_name(class_name), depth)
        end
        options[:only].uniq!
      end

      filtered_entities.each do |entity|
        instance_exec entity, filtered_attributes(entity), &callbacks[:each_entity]
      end

      filtered_specializations.each do |specialization|
        instance_exec specialization, &callbacks[:each_specialization]
      end

      filtered_relationships.each do |relationship|
        instance_exec relationship, &callbacks[:each_relationship]
      end
    end
def generate
      instance_eval(&callbacks[:setup])
      if options.only_recursion_depth.present?
        depth = options.only_recursion_depth.to_i
        options[:only].dup.each do |class_name|
          options[:only]+= recurse_into_relationships(@domain.entity_by_name(class_name), depth)
        end
        options[:only].uniq!
      end

      filtered_entities.each do |entity|
        instance_exec entity, filtered_attributes(entity), &callbacks[:each_entity]
      end

      filtered_specializations.each do |specialization|
        instance_exec specialization, &callbacks[:each_specialization]
      end

      filtered_relationships.each do |relationship|
        instance_exec relationship, &callbacks[:each_relationship]
      end
    end
Generates the diagram, but does not save the output. It is called
 internally by Diagram#create.