Sha256: 4939a4551a6edd65e93ad936549b39f0b64406b55d55402923fe46440821edfd

Contents?: true

Size: 1.19 KB

Versions: 25

Compression:

Stored size: 1.19 KB

Contents

module PowerStencil
  module SystemEntityDefinitions

    module EntityProjectCommon

        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[type].nil?
          PowerStencil.project.generate_entity_dir_for_entity self, force: force_files_generation
        end
        self
      end

      def delete(force_files_deletion: false)
        unless PowerStencil.project.entity_type_templates[type].nil?
          PowerStencil.project.delete_entity_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

25 entries across 25 versions & 1 rubygems

Version Path
power_stencil-0.6.1 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.6.0 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.5.1 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.5.0 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.22 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.21 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.20 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.19 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.18 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.17 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.16 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.15 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.14 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.13 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.12 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.11 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.10 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.9 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.8 lib/power_stencil/system_entity_definitions/entity_project_common.rb
power_stencil-0.4.7 lib/power_stencil/system_entity_definitions/entity_project_common.rb