<commit_before>module WeatherWeasel
  class Forecast
    
    def initialize(city, state, temperature_format, client)
      @city = city
      @state = state
      @temperature_format = temperature_format
      @client = client
    end
    
    def forecast_data
      @client.parse_url("forecast/q/#{@state}/#{@city}.json")
    end
    def high
      all_highs.max
    end
    
    def low
      all_lows.min
    end
    
    def all_lows
      days = forecast_data["forecast"]["simpleforecast"]["forecastday"]
      lows = []
      days.each do |day|
        lows << day["low"][@temperature_format]
      end
      lows
    end
    
    def all_highs
      days = forecast_data["forecast"]["simpleforecast"]["forecastday"]<commit_msg>Add "forecast_days" concept & refactor all_lows to use collect method<commit_after>module WeatherWeasel
  class Forecast
    
    def initialize(city, state, temperature_format, client)
      @city = city
      @state = state
      @temperature_format = temperature_format
      @client = client
    end
    
    def forecast_data
      @client.parse_url("forecast/q/#{@state}/#{@city}.json")
    end

    def forecast_days
      forecast_data["forecast"]["simpleforecast"]["forecastday"]
    end

    def high
      all_highs.max
    end
    
    def low
      all_lows.min
    end
    
    def all_lows
      forecast_days.collect do |day|
        day["low"][@temperature_format]
      end
    end
    
    def all_highs
      days = forecast_data["forecast"]["simpleforecast"]["forecastday"]
{'fraction_non_alphanumeric': 0.09869281045751634, 'fraction_numerical': 0.0, 'mean_word_length': 2.455981941309255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '219977', 'n_tokens_mistral': 479, 'n_tokens_neox': 490, 'n_words': 100}