Class: Runt::Collection
Overview
Base class for TExpr classes that can be composed of other TExpr objects imlpemented using the Composite(GoF)
pattern.
Instance Method Summary collapse
- #add(anExpression) ⇒ Object
-
#initialize ⇒ Collection
constructor
A new instance of Collection.
- #to_s ⇒ Object
Methods inherited from TExpr
#&, #-, #and, #include?, #minus, #or, #|
Constructor Details
#initialize ⇒ Collection
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_s ⇒ Object
118 |
# File 'lib/runt/temporalexpression.rb', line 118 def to_s; "Collection:" + @expressions.to_s end |