Class: ActiveFacts::CQL::Compiler::Negation
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::Negation
- Defined in:
- lib/activefacts/cql/compiler/expression.rb
Instance Attribute Summary collapse
-
#term ⇒ Object
Returns the value of attribute term.
Instance Method Summary collapse
- #compile(context) ⇒ Object
- #identify_player(context) ⇒ Object
-
#initialize(term) ⇒ Negation
constructor
A new instance of Negation.
- #inspect ⇒ Object
- #operator ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(term) ⇒ Negation
Returns a new instance of Negation.
411 412 413 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 411 def initialize term @term = term end |
Instance Attribute Details
#term ⇒ Object
Returns the value of attribute term.
410 411 412 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 410 def term @term end |
Instance Method Details
#compile(context) ⇒ Object
433 434 435 436 437 438 439 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 433 def compile(context) op1 = @term.compile(context) context.vocabulary.constellation.Expression( :new, :expression_type => 'Unary', :operator => operator, :first_operand_expression => op1 ) end |
#identify_player(context) ⇒ Object
419 420 421 422 423 424 425 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 419 def identify_player context @player || begin # The player in @term have already been identified v = context.vocabulary @player = @term.player end end |
#inspect ⇒ Object
427 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 427 def inspect; to_s; end |
#operator ⇒ Object
415 416 417 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 415 def operator 'not' end |
#to_s ⇒ Object
429 430 431 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 429 def to_s "NEGATION(#{term.to_s})" end |