Method: Timeframe#year

Defined in:
lib/timeframe.rb

#yearObject

Returns the relevant year as a Timeframe

Raises:

  • (ArgumentError)


190
191
192
193
# File 'lib/timeframe.rb', line 190

def year
  raise ArgumentError, 'Timeframes that cross year boundaries are dangerous during Timeframe#year' unless start_date.year == end_date.yesterday.year
  Timeframe.new :year => start_date.year
end