Class: Runt::Diff
- Inherits:
-
Object
- Object
- Runt::Diff
- Includes:
- TExpr
- Defined in:
- lib/runt/temporalexpression.rb
Overview
TExpr that will be true only if the first of its two contained expressions is true and the second is false.
Instance Attribute Summary collapse
-
#expr1 ⇒ Object
readonly
Returns the value of attribute expr1.
-
#expr2 ⇒ Object
readonly
Returns the value of attribute expr2.
Instance Method Summary collapse
- #include?(aDate) ⇒ Boolean
-
#initialize(expr1, expr2) ⇒ Diff
constructor
A new instance of Diff.
- #to_s ⇒ Object
Methods included from TExpr
#&, #-, #and, #dates, #minus, #or, #|
Constructor Details
#initialize(expr1, expr2) ⇒ Diff
Returns a new instance of Diff.
176 177 178 179 |
# File 'lib/runt/temporalexpression.rb', line 176 def initialize(expr1, expr2) @expr1 = expr1 @expr2 = expr2 end |
Instance Attribute Details
#expr1 ⇒ Object (readonly)
Returns the value of attribute expr1.
174 175 176 |
# File 'lib/runt/temporalexpression.rb', line 174 def expr1 @expr1 end |
#expr2 ⇒ Object (readonly)
Returns the value of attribute expr2.
174 175 176 |
# File 'lib/runt/temporalexpression.rb', line 174 def expr2 @expr2 end |
Instance Method Details
#include?(aDate) ⇒ Boolean
181 182 183 184 |
# File 'lib/runt/temporalexpression.rb', line 181 def include?(aDate) return false unless (@expr1.include?(aDate) && !@expr2.include?(aDate)) true end |
#to_s ⇒ Object
186 187 188 |
# File 'lib/runt/temporalexpression.rb', line 186 def to_s @expr1.to_s + ' except for ' + @expr2.to_s end |