Module: TimeCrisis::MeteorologicalSeasons::InstanceMethods

Defined in:
lib/time_crisis/meteorological_seasons.rb

Instance Method Summary collapse

Instance Method Details

#meteorological_autumn?Boolean Also known as: meteorological_fall?

Returns:

  • (Boolean)


43
44
45
# File 'lib/time_crisis/meteorological_seasons.rb', line 43

def meteorological_autumn?
  [9, 10, 11].include?(self.month)
end

#meteorological_seasonObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/time_crisis/meteorological_seasons.rb', line 53

def meteorological_season
  case self.month
    when (1..2) then
      'winter'
    when (3..5) then
      'spring'
    when (6..8) then
      'summer'
    when (9..11) then
      'fall'
    when 12 then
      'winter'
  end
end

#meteorological_spring?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/time_crisis/meteorological_seasons.rb', line 35

def meteorological_spring?
  [3, 4, 5].include?(self.month)
end

#meteorological_summer?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/time_crisis/meteorological_seasons.rb', line 39

def meteorological_summer?
  [6, 7, 8].include?(self.month)
end

#meteorological_winter?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/time_crisis/meteorological_seasons.rb', line 49

def meteorological_winter?
  [1, 2, 12].include?(self.month)
end