Sha256: 650b18f87db06dc20c56794850957a8f499ac40b79628c0e3ea59f98c607c252

Contents?: true

Size: 627 Bytes

Versions: 8

Compression:

Stored size: 627 Bytes

Contents

require_relative "model"

module Foobara
  module Manifest
    class Entity < DetachedEntity
      # this isn't inherited? why not?
      self.category_symbol = :type

      alias entity_manifest model_manifest

      def has_associations?
        associations && !associations.empty?
      end

      def full_entity_name
        full_model_name
      end

      # TODO: should this instead be on DetachedEntity??
      def associations
        @associations ||= self[:associations].to_h do |path_key, type_name|
          [path_key.to_sym, Type.new(root_manifest, [:type, type_name])]
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foobara-0.0.38 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.37 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.36 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.35 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.34 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.33 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.32 projects/manifest/src/foobara/manifest/entity.rb
foobara-0.0.31 projects/manifest/src/foobara/manifest/entity.rb