Class: Runt::Intersect

Inherits:
Collection show all
Defined in:
lib/runt/temporalexpression.rb

Overview

Composite TExpr that will be true only if all it’s component expressions are true.

Instance Method Summary collapse

Methods inherited from Collection

#add, #initialize

Methods inherited from TExpr

#&, #-, #and, #minus, #or, #|

Constructor Details

This class inherits a constructor from Runt::Collection

Instance Method Details

#include?(aDate) ⇒ Boolean

Returns:

  • (Boolean)


139
140
141
142
143
144
145
146
# File 'lib/runt/temporalexpression.rb', line 139

def include?(aDate)
  #Handle @expressions.size==0
  result = false
  @expressions.each do |expr|
    return false unless (result = expr.include?(aDate))
  end
  result
end

#to_sObject



148
# File 'lib/runt/temporalexpression.rb', line 148

def to_s; "Intersect:" + @expressions.to_s end