class RockBooks::DateRangeError

Attributes

date[R]
end_date[R]
extra_string[R]
start_date[R]

Public Class Methods

new(date, start_date, end_date, extra_string = nil) click to toggle source
# File lib/rock_books/errors/date_range_error.rb, line 6
def initialize(date, start_date, end_date, extra_string = nil)
  @date = date
  @start_date = start_date
  @end_date = end_date
  @extra_string = extra_string
end

Public Instance Methods

to_s() click to toggle source
# File lib/rock_books/errors/date_range_error.rb, line 13
def to_s
  s = "#{date} is not within this data set's period of #{start_date} to #{end_date}"
  s << " (#{extra_string})" if extra_string
  s << '.'
  s
end