Class: Runt::BeforeTE
- Inherits:
-
Object
- Object
- Runt::BeforeTE
- Includes:
- TExpr
- Defined in:
- lib/runt/temporalexpression.rb
Overview
Matches dates that occur before a given date.
Instance Method Summary collapse
- #include?(date) ⇒ Boolean
-
#initialize(date, inclusive = false) ⇒ BeforeTE
constructor
A new instance of BeforeTE.
- #to_s ⇒ Object
Methods included from TExpr
#&, #-, #and, #dates, #minus, #or, #|
Constructor Details
#initialize(date, inclusive = false) ⇒ BeforeTE
Returns a new instance of BeforeTE.
760 761 762 763 |
# File 'lib/runt/temporalexpression.rb', line 760 def initialize(date, inclusive=false) @date = date @inclusive = inclusive end |
Instance Method Details
#include?(date) ⇒ Boolean
765 766 767 |
# File 'lib/runt/temporalexpression.rb', line 765 def include?(date) return (date < @date) || (@inclusive && @date == date) end |
#to_s ⇒ Object
769 770 771 |
# File 'lib/runt/temporalexpression.rb', line 769 def to_s "before #{Runt.format_date(@date)}" end |