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.



735
736
737
# File 'lib/runt/temporalexpression.rb', line 735

def initialize(year)
  @year = year
end

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


739
740
741
# File 'lib/runt/temporalexpression.rb', line 739

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

#to_sObject



743
744
745
# File 'lib/runt/temporalexpression.rb', line 743

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