Sha256: 855e6ff956a72f10835591f44d476b888ad9e2f8caae3339c56cca958fe1f37e

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require_relative 'pass_thru'

module ConceptQL
  module Operators
    # Mimics using a variable that has been set via "define" operator
    #
    # The idea is that a concept might be very complex and it helps to break
    # that complex concept into a set of sub-concepts to better understand it.
    #
    # This operator will look for a sub-concept that has been created through the
    # "define" operator and will fetch the results cached in the corresponding table
    class Recall < Operator
      desc <<-EOF
Recalls a set of named results that were previously stored using the Define operator.
Must be surrounded by the same Let operator as surrounds the corresponding Define operator.
      EOF
      argument :name, type: :string
      category 'Variable Assignment'

      def query(db)
        scope.from(db, source)
      end

      def columns(query, local_type)
        COLUMNS
      end

      def types
        scope.types(source)
      end

      def source
        arguments.first
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conceptql-0.2.0 lib/conceptql/operators/recall.rb