Class: FuncBot::Functions::WeatherFunction

Inherits:
BaseFunction show all
Defined in:
lib/generators/func_bot/templates/weather_function.rb

Instance Attribute Summary

Attributes inherited from BaseFunction

#bot

Instance Method Summary collapse

Methods inherited from BaseFunction

#initialize, #parsed_response

Constructor Details

This class inherits a constructor from FuncBot::Functions::BaseFunction

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
17
# File 'lib/generators/func_bot/templates/weather_function.rb', line 9

def execute
  weather_info = {
    location: parsed_response["location"],
    temperature: 98,
    forecast: ["sunny", "windy"]
  }

  JSON.dump(weather_info)
end