Exception: Masheri::InvalidDateRange
- Inherits:
-
Exception
- Object
- Exception
- Masheri::InvalidDateRange
- Defined in:
- lib/masheri/exceptions.rb
Instance Method Summary collapse
-
#initialize(start_date, end_date) ⇒ InvalidDateRange
constructor
A new instance of InvalidDateRange.
Constructor Details
#initialize(start_date, end_date) ⇒ InvalidDateRange
Returns a new instance of InvalidDateRange.
9 10 11 12 13 |
# File 'lib/masheri/exceptions.rb', line 9 def initialize(start_date, end_date) days = ((end_date - start_date) / 1.day).ceil super("Your start_date and end_date are #{days} days apart. Mashery's API does not like date ranges that span longer than 7 days. Please use multiple queries to gather your data.") end |