lib/owmo.rb in owmo-1.0.1 vs lib/owmo.rb in owmo-1.1.0
- old
+ new
@@ -23,9 +23,15 @@
puts weather.get :current, city_name: "London,uk"
end
=end
public
def self.weather(api_key, **params)
- yield Weather.new api_key, params
+ weather = Weather.new(api_key, params)
+
+ if block_given?
+ yield weather
+ else
+ return weather
+ end
end # weather
end # OWMO