Class: Runt::YearTE

Inherits:
Object
  • Object
show all
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

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

Returns:

  • (Boolean)


745
746
747
# File 'lib/runt/temporalexpression.rb', line 745

def include?(date)
  return date.year == @year
end

#to_sObject



749
750
751
# File 'lib/runt/temporalexpression.rb', line 749

def to_s
  "during the year #{@year}"
end