Sha256: 89d817621d1ec8ff28b5f6a108ff6d350d57f8af61310133bade3e02a61ecf6c

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

module Alf
  module Algebra
    class Unwrap
      include Operator
      include Relational
      include Unary

      signature do |s|
        s.argument :attribute, AttrName, :wrapped
      end

      def heading
        @heading ||= begin
          op_h = operand.heading
          op_h.allbut([attribute]).merge(op_h[attribute].heading)
        end
      end

      def keys
        operand.keys
      end

    private

      def _type_check(options)
        ungrouped = operand.heading[attribute]
        unless ungrouped.ancestors.include?(Tuple)
          type_check_error!("not a tuple-valued attribute `#{attribute}` (#{ungrouped})")
        end
        no_name_clash!(operand.attr_list, ungrouped.heading.to_attr_list)
      end

    end # class Unwrap
  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/unwrap.rb