### Home Classes Methods

### In Files

- lib/chronic/season.rb

### Parent

Object

### Methods

- ::find_next_season
- ::new
- ::season_after
- ::season_before

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Chronic
- Chronic::Date
- Chronic::Grabber
- Chronic::Handler
- Chronic::Handlers
- Chronic::MiniDate
- Chronic::Numerizer
- Chronic::Ordinal
- Chronic::Parser
- Chronic::Pointer
- Chronic::Repeater
- Chronic::Scalar
- Chronic::Season
- Chronic::Separator
- Chronic::Sign
- Chronic::Span
- Chronic::Tag
- Chronic::Time
- Chronic::TimeZone
- Chronic::Token

No matching classes.

# Chronic::Season

### Attributes

end[R]
start[R]

### Public Class Methods

find_next_season(season, pointer) click to toggle source

    # File lib/chronic/season.rb, line 12
    def self.find_next_season(season, pointer)
      lookup = [:spring, :summer, :autumn, :winter]
      next_season_num = (lookup.index(season) + 1 * pointer) % 4
      lookup[next_season_num]
    end

new(start_date, end_date) click to toggle source

    # File lib/chronic/season.rb, line 7
    def initialize(start_date, end_date)
      @start = start_date
      @end = end_date
    end

season_after(season) click to toggle source

    # File lib/chronic/season.rb, line 18
    def self.season_after(season)
      find_next_season(season, +1)
    end

season_before(season) click to toggle source

    # File lib/chronic/season.rb, line 22
    def self.season_before(season)
      find_next_season(season, -1)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.