Skip to content

Commit 3044ddc

Browse files
committed
Adding units as a valid options
1 parent 150d605 commit 3044ddc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Add the following to your **Gemfile**
2525
# get current weather by geocode. (lat, lon)
2626
OpenWeather::Current.geocode(9.94, 76.26)
2727

28+
# get the current weather in degrees celsius
29+
OpenWeather::Current.city("Cochin, IN", units: 'metric')
30+
2831
# weather forecast APIs
2932

3033
# get weather forecast by city name

lib/open_weather/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def success?
2424
private
2525

2626
def extract_options!(options)
27-
valid_options = [:lat, :lon, :city, :country, :id]
27+
valid_options = [:lat, :lon, :city, :country, :id, :units]
2828
options.keys.each { |k| options.delete(k) unless valid_options.include?(k) }
2929

3030
if options[:city] || options[:country]

0 commit comments

Comments
 (0)