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.
735 736 737 |
# File 'lib/runt/temporalexpression.rb', line 735 def initialize(year) @year = year end |
Instance Method Details
#include?(date) ⇒ Boolean
739 740 741 |
# File 'lib/runt/temporalexpression.rb', line 739 def include?(date) return date.year == @year end |
#to_s ⇒ Object
743 744 745 |
# File 'lib/runt/temporalexpression.rb', line 743 def to_s "during the year #{@year}" end |