Class: ConceptQL::Operators::Numeric

Inherits:
PassThru show all
Defined in:
lib/conceptql/operators/numeric.rb

Overview

Represents a operator that will either:

  • create a value_as_number value for every person in the database

  • change the value_as_number value for every every result passed in

    • either to a number

    • or a value from a column in the origin row

Accepts two params:

  • Either a number value or a symbol representing a column name

  • An optional stream

Constant Summary

Constants inherited from Operator

Operator::COLUMNS

Instance Attribute Summary

Attributes inherited from Operator

#arguments, #options, #upstreams, #values

Instance Method Summary collapse

Methods inherited from Operator

#columns, #evaluate, #initialize, #label, #select_it, #set_values, #sql, #stream

Methods included from Metadatable

#allows_many_upstreams, #allows_one_upstream, #argument, #category, #desc, #humanized_class_name, #inherited, #just_class_name, #option, #predominant_types, #preferred_name, #reset_categories, #to_metadata

Constructor Details

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

Instance Method Details

#query(db) ⇒ Object



29
30
31
# File 'lib/conceptql/operators/numeric.rb', line 29

def query(db)
  stream.nil? ? as_criterion(db) : with_kids(db)
end

#typesObject



33
34
35
# File 'lib/conceptql/operators/numeric.rb', line 33

def types
  stream.nil? ? [:person] : super
end