Class: Runt::YearTE
- Inherits:
-
Object
- Object
- Runt::YearTE
- Includes:
- TExpr
- Defined in:
- lib/runt/temporalexpression.rb
Overview
Simple expression which returns true if the supplied arguments occur within the given year.
Instance Method Summary collapse
- #include?(date) ⇒ Boolean
-
#initialize(year) ⇒ YearTE
constructor
A new instance of YearTE.
- #to_s ⇒ Object
Methods included from TExpr
#&, #-, #and, #dates, #minus, #or, #|
Constructor Details
#initialize(year) ⇒ YearTE
Returns a new instance of YearTE.
741 742 743 |
# File 'lib/runt/temporalexpression.rb', line 741 def initialize(year) @year = year end |
Instance Method Details
#include?(date) ⇒ Boolean
745 746 747 |
# File 'lib/runt/temporalexpression.rb', line 745 def include?(date) return date.year == @year end |
#to_s ⇒ Object
749 750 751 |
# File 'lib/runt/temporalexpression.rb', line 749 def to_s "during the year #{@year}" end |