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

Fix behaviour and typespec of last_updated/0 #77

Merged
merged 1 commit into from
Aug 28, 2018

Conversation

xavier
Copy link
Contributor

@xavier xavier commented Aug 28, 2018

The current implementation of Money.ExchangeRates.last_updated/0 keeps returning nil as it expects the cache to return an {:ok, %DateTime{}} tuple but it actually returns a %DateTime{}.

In addition, the documentation, typespec and implementation all disagree on the return type of this function. This PR fixes both the implementation and typespec to align with the documented behaviour.

The cache layer now returns {:ok, %DateTime{}} or {:error, reason} tuples which are forwarded to the caller in the facade module.

@kipcole9 kipcole9 merged commit 3b17853 into kipcole9:master Aug 28, 2018
@kipcole9
Copy link
Owner

@xavier thank you very much! Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants