Sha256: 18393ac3241a295153471c6205ee371555f50fd83395c2c9c36d717e185a4941

Contents?: true

Size: 1.35 KB

Versions: 30

Compression:

Stored size: 1.35 KB

Contents

module PowerStencil
  module SystemEntityDefinitions

    module EntityProjectCommon

      def is_versioned_entity?
        @is_versioned_entity
      end

      def is_user_entity?
        not(@is_versioned_entity)
      end

      def save(uri = source_uri, raise_error: true, force_save: false, force_files_generation: false )
        super(source_uri, raise_error: raise_error, force_save: force_save)
        unless PowerStencil.project.entity_type_templates_templates[type].nil?
          PowerStencil.project.generate_template_dir_for_entity self, force: force_files_generation
        end
        self
      end

      def delete(force_files_deletion: false)
        unless PowerStencil.project.entity_type_templates_templates[type].nil?
          PowerStencil.project.delete_template_dir_for_entity self, force: force_files_deletion
        end
        super()
        self
      end

      def buildable_by
        self.class.buildable_by
      end

      def buildable?
        self.class.buildable?
      end

      protected

      def project_engine
        PowerStencil.project.engine
      end

      def create_universe_entity(type, fields = {})
        project_engine.new_entity project_engine.root_universe, type, fields: fields
      end

      def remove_entity_from_universe(entity)
        project_engine.root_universe.delete entity
      end

    end

  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
power_stencil-0.10.0 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.8 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.7 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.6 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.5 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.4 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.3 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.2 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.1 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.9.0 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.14 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.13 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.12 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.11 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.10 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.9 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.8 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.7 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.6 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.8.5 lib/power_stencil/system_entity_definitions/entity_project_common.rb