Sha256: 3f150c9f584b2b0384cc17e247e668771d909b2fb24cc7bfc757d50b81bf8e2a

Contents?: true

Size: 612 Bytes

Versions: 2

Compression:

Stored size: 612 Bytes

Contents

module WeatherUganda
  class Recommendations
    def self.suggestions(weather_data)
      temp = weather_data["main"]["temp"]
      condition = weather_data["weather"].first["main"]

      case condition.downcase
      when "rain"
        "It's rainy! Great time for indoor activities. Farmers, consider planting crops like maize."
      when "clear"
        "It's clear and sunny! Perfect for outdoor sports or drying crops."
      when "clouds"
        "Cloudy skies—might be a good day to plan for light farming tasks."
      else
        "Stay prepared for unexpected weather."
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weather_uganda-0.1.1 lib/weather_uganda/recommendations.rb
weather_uganda-0.1.0 lib/weather_uganda/recommendations.rb