Class: TExp::Not

Inherits:
SingleTermBase show all
Defined in:
lib/texp/logic.rb

Overview

Logically NEGATE a temporal expression. A date is included if it is not included in the sub-expression.

Instance Method Summary collapse

Methods inherited from SingleTermBase

#each, #initialize, #reanchor

Methods inherited from Base

#*, #+, #-, #-@, #each, #first_day_of_window, #include?, #last_day_of_window, parse_callback, #reanchor, register_parse_callback, #to_s, #window

Constructor Details

This class inherits a constructor from TExp::SingleTermBase

Instance Method Details

#encode(codes) ⇒ Object

Encode the temporal expression into codes.



66
67
68
69
# File 'lib/texp/logic.rb', line 66

def encode(codes)
  @term.encode(codes)
  codes << encoding_token
end

#includes?(date) ⇒ Boolean

Is date included in the temporal expression.

Returns:

  • (Boolean)


56
57
58
# File 'lib/texp/logic.rb', line 56

def includes?(date)
  ! @term.includes?(date)
end

#inspectObject

Human readable version of the temporal expression.



61
62
63
# File 'lib/texp/logic.rb', line 61

def inspect
  "it is not the case that " + @term.inspect
end