Class: ActiveFacts::CQL::Compiler::Negate
- Inherits:
-
Object
- Object
- ActiveFacts::CQL::Compiler::Negate
- 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) ⇒ Negate
constructor
A new instance of Negate.
- #inspect ⇒ Object
- #operator ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(term) ⇒ Negate
Returns a new instance of Negate.
378 379 380 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 378 def initialize term @term = term end |
Instance Attribute Details
#term ⇒ Object
Returns the value of attribute term.
377 378 379 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 377 def term @term end |
Instance Method Details
#compile(context) ⇒ Object
400 401 402 403 404 405 406 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 400 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
386 387 388 389 390 391 392 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 386 def identify_player context @player || begin # The player in @term have already been identified v = context.vocabulary @player = @term.player end end |
#inspect ⇒ Object
394 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 394 def inspect; to_s; end |
#operator ⇒ Object
382 383 384 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 382 def operator '0-' end |
#to_s ⇒ Object
396 397 398 |
# File 'lib/activefacts/cql/compiler/expression.rb', line 396 def to_s "NEGATIVE(#{term.to_s})" end |