Sha256: 4eaec5bc90a68ffdc6424a76e74371edc397b3b85dc59511e98278a781e808c9

Contents?: true

Size: 705 Bytes

Versions: 1

Compression:

Stored size: 705 Bytes

Contents

module Alf
  module Algebra
    class Hierarchize
      include Operator, Relational, Unary, Experimental

      signature do |s|
        s.argument :id,     AttrList, [:id]
        s.argument :parent, AttrList, [:parent]
        s.argument :as,     AttrName, [:children]
      end

      def heading
        @heading ||= Relation.type(operand.heading){|r| {as => r}}.heading
      end

      def keys
        operand.keys
      end

    private

      def _type_check(options)
        no_unknown!(id - operand.attr_list)
        no_unknown!(parent - operand.attr_list)
        no_name_clash!(operand.attr_list, AttrList[as])
      end

    end # class Hierarchize
  end # module Algebra
end # module Alf

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-core-0.15.0 lib/alf/algebra/operator/hierarchize.rb