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.



723
724
725
# File 'lib/runt/temporalexpression.rb', line 723

def initialize(year)
  @year = year
end

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


727
728
729
# File 'lib/runt/temporalexpression.rb', line 727

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

#to_sObject



731
732
733
# File 'lib/runt/temporalexpression.rb', line 731

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