Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance README with examples #36

Merged
merged 6 commits into from
Mar 15, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,21 @@ data.main.temp # => 12
```

Returns weather by city, optional state (in the US) and optional ISO 3166 country code.
Names that cannot be resolved will cause the API call to fail with Faraday::ResourceNotFound error.
mattlindsey marked this conversation as resolved.
Show resolved Hide resolved

```ruby
client.current_city('New York', 'NY', 'US')
client.current_weather(city: 'New York', state: 'NY', country: 'US')
client.current_city('Sydney')
client.current_city('London, UK')
client.current_city('London', 'UK')
client.current_city('Albany')
client.current_city('Albany, New York')
client.current_city('Albany, New York', 'US')
client.current_city('Albany, NY', 'US')
client.current_city('Albany', 'New York', 'US')
client.current_city('Albany', 'NY', 'US')
client.current_city('Albany', 'NY') # 2-letter state abbreviation w/o country will raise Faraday::ResourceNotFound"
mattlindsey marked this conversation as resolved.
Show resolved Hide resolved

client.current_weather(city: 'Albany', state: 'NY', country: 'US')
```

Returns weather by city ID.
Expand Down
Loading