Class: Runt::REYear

Inherits:
TExpr
  • Object
show all
Defined in:
lib/runt/temporalexpression.rb

Instance Method Summary collapse

Methods inherited from TExpr

#&, #-, #and, #minus, #or, #|

Constructor Details

#initialize(start_month, start_day = 0, end_month = start_month, end_day = 0) ⇒ REYear

Returns a new instance of REYear.



341
342
343
344
345
346
347
# File 'lib/runt/temporalexpression.rb', line 341

def initialize(start_month, start_day=0, end_month=start_month, end_day=0)
  super()
  @start_month = start_month
  @start_day = start_day
  @end_month = end_month
  @end_day = end_day
end

Instance Method Details

#include?(date) ⇒ Boolean

Returns:

  • (Boolean)


349
350
351
352
353
# File 'lib/runt/temporalexpression.rb', line 349

def include?(date)
  months_include?(date) ||
    start_month_include?(date) ||
      end_month_include?(date)
end


359
360
361
362
363
364
365
# File 'lib/runt/temporalexpression.rb', line 359

def print(date)
  puts "DIMonth: #{date}"
  puts "include? == #{include?(date)}"
  puts "months_include? == #{months_include?(date)}"
  puts "end_month_include? == #{end_month_include?(date)}"
  puts "start_month_include? == #{start_month_include?(date)}"
end

#to_sObject



355
356
357
# File 'lib/runt/temporalexpression.rb', line 355

def to_s
  "REYear"
end