Class: ConceptQL::Operators::Recall

Inherits:
Operator
  • Object
show all
Defined in:
lib/conceptql/operators/recall.rb

Overview

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

Instance Attribute Summary

Attributes inherited from Operator

#arguments, #errors, #nodifier, #options, #upstreams, #values

Instance Method Summary collapse

Methods inherited from Operator

#cast_column, #code_list, codes_should_match, #columns, #create_upstreams, #data_model, #database_type, default_query_columns, #dup_values, #dynamic_columns, #evaluate, inherited, #initialize, #inspect, #label, new, #operator_name, #optimized, query_columns, register, require_column, #required_columns, #scope, #select_it, #setup_select, #sql, #stream, #to_op, #unionable?, #upstreams_valid?, #valid?

Methods included from Metadatable

#allows_many_upstreams, #allows_one_upstream, #argument, #auto_label, #basic_type, #category, #derive_metadata_from_validations, #desc, #get_desc, #humanized_class_name, #inherited, #just_class_name, #no_desc, #option, #predominant_domains, #pref_name, #preferred_name, #reset_categories, #standard_description, #to_metadata, #validate_at_least_one_upstream_to_metadata, #validate_at_most_one_upstream_to_metadata, #validate_no_arguments_to_metadata, #validate_no_upstreams_to_metadata, #validate_one_upstream_to_metadata, #validate_required_options_to_metadata, #warn_about_missing_metadata

Constructor Details

This class inherits a constructor from ConceptQL::Operators::Operator

Instance Method Details

#annotate(db, opts = {}) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/conceptql/operators/recall.rb', line 38

def annotate(db, opts = {})
  @annotate ||= if valid?(db) && replaced?
    original.annotate(db, opts)
  else
    super
  end
end

#domains(db) ⇒ Object



30
31
32
# File 'lib/conceptql/operators/recall.rb', line 30

def domains(db)
  scope.domains(source, db)
end

#originalObject



46
47
48
# File 'lib/conceptql/operators/recall.rb', line 46

def original
  nodifier.scope.fetch_operator(source)
end

#query(db) ⇒ Object



26
27
28
# File 'lib/conceptql/operators/recall.rb', line 26

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

#sourceObject



34
35
36
# File 'lib/conceptql/operators/recall.rb', line 34

def source
  arguments.first
end