Sha256: c55c5e15e5559292060085fdbae857445452515699365df3139cad0f25554210

Contents?: true

Size: 672 Bytes

Versions: 4

Compression:

Stored size: 672 Bytes

Contents

module Alf
  module Algebra
    class Image
      include Shortcut
      include Binary

      signature do |s|
        s.argument :name, AttrName, []
      end

      def keys
        left.keys
      end

      def expand
        grouped = join(left, group(right, common_attrs, name, allbut: true))
        missing = extend(not_matching(left, right), name => group_type.empty)
        union(grouped, missing)
      end

    private

      def common_attrs
        left.attr_list & right.attr_list
      end

      def group_type
        @group_type ||= Relation[right.heading.allbut(common_attrs)]
      end

    end # class Image
  end # module Algebra
end # module Alf

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/algebra/shortcut/image.rb
alf-core-0.16.2 lib/alf/algebra/shortcut/image.rb
alf-core-0.16.1 lib/alf/algebra/shortcut/image.rb
alf-core-0.16.0 lib/alf/algebra/shortcut/image.rb