Sha256: 79bd646270fc040857947d615a432a7b083b9b0b0039212fe761c2f5b8f04991

Contents?: true

Size: 651 Bytes

Versions: 6

Compression:

Stored size: 651 Bytes

Contents

module Rasti
  module DB
    module NQL
      module Nodes
        class BinaryNode < Treetop::Runtime::SyntaxNode
          
          def dependency_tables
            values.flat_map(&:dependency_tables)
          end

          def computed_attributes(collection_class)
            left.computed_attributes(collection_class) | right.computed_attributes(collection_class)
          end

          def values
            @values ||= values_for(left) + values_for(right)
          end

          private

          def values_for(node)
            node.class == self.class ? node.values : [node]
          end

        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rasti-db-2.3.3 lib/rasti/db/nql/nodes/binary_node.rb
rasti-db-2.3.2 lib/rasti/db/nql/nodes/binary_node.rb
rasti-db-2.3.1 lib/rasti/db/nql/nodes/binary_node.rb
rasti-db-2.3.0 lib/rasti/db/nql/nodes/binary_node.rb
rasti-db-2.2.0 lib/rasti/db/nql/nodes/binary_node.rb
rasti-db-2.1.0 lib/rasti/db/nql/nodes/binary_node.rb