Class: Runt::Collection

Inherits:
TExpr
  • Object
show all
Defined in:
lib/runt/temporalexpression.rb

Overview

Base class for TExpr classes that can be composed of other TExpr objects imlpemented using the Composite(GoF) pattern.

Direct Known Subclasses

Intersect, Union

Instance Method Summary collapse

Methods inherited from TExpr

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

Constructor Details

#initializeCollection

Returns a new instance of Collection.



109
110
111
# File 'lib/runt/temporalexpression.rb', line 109

def initialize
  @expressions = Array.new
end

Instance Method Details

#add(anExpression) ⇒ Object



113
114
115
116
# File 'lib/runt/temporalexpression.rb', line 113

def add(anExpression)
  @expressions.push anExpression
  self
end

#to_sObject



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

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