Class: NoaaWeatherClient::Templates::Forecast

Inherits:
Struct
  • Object
show all
Defined in:
lib/noaa_weather_client/cli/templates.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#forecastObject

Returns the value of attribute forecast

Returns:

  • (Object)

    the current value of forecast



44
45
46
# File 'lib/noaa_weather_client/cli/templates.rb', line 44

def forecast
  @forecast
end

Instance Method Details

#to_sObject



45
46
47
48
49
50
# File 'lib/noaa_weather_client/cli/templates.rb', line 45

def to_s
  template = "\n#{forecast.days.size}-Day Forecast\n"
  template += "================================================================================\n"
  forecast.days.each { |d| template +=  ForecastDay.new(d).to_s }
  template
end