class ExistClient::ReportPeriod

Attributes

end_time[R]
start_time[R]

Public Class Methods

new(last_report_date) click to toggle source
# File lib/exist_client/report_period.rb, line 7
def initialize(last_report_date)
  date = last_report_date + 1
  end_date = logical_date(Time.now)

  @start_time = Time.new(date.year, date.month, date.day, Config.cutoff_hour)
  @end_time = Time.new(end_date.year, end_date.month, end_date.day, Config.cutoff_hour) - 1
end

Public Instance Methods

include?(time) click to toggle source
# File lib/exist_client/report_period.rb, line 19
def include?(time)
  time.between?(start_time, end_time)
end
valid?() click to toggle source
# File lib/exist_client/report_period.rb, line 15
def valid?
  start_time < end_time
end