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

Add Sequence.next/1 for quickly creating sequences #84

Merged
merged 1 commit into from
Jan 9, 2016

Conversation

paulcsmith
Copy link
Contributor

Closes #66

@@ -3,6 +3,12 @@ defmodule ExMachina.Sequence do
Agent.start_link(fn -> HashDict.new end, name: __MODULE__)
end

def next(sequence_name) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we raise a helpful error for non-string values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I'm not sure though. Should we raise, or should we convert it to a string? I think raise, but just want to make sure :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should raise. I think anything else would be unexpected and unlikely to be helpful (if not harmful).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. I'll make it raise :)

Sent from my iPhone

On Jan 8, 2016, at 8:21 PM, Josh Steiner [email protected] wrote:

In lib/ex_machina/sequence.ex:

@@ -3,6 +3,12 @@ defmodule ExMachina.Sequence do
Agent.start_link(fn -> HashDict.new end, name: MODULE)
end

  • def next(sequence_name) do
    I think we should raise. I think anything else would be unexpected and unlikely to be helpful (if not harmful).


Reply to this email directly or view it on GitHub.

@jsteiner
Copy link
Contributor

jsteiner commented Jan 8, 2016

One question/comment. Otherwise 👍

@paulcsmith paulcsmith merged commit faf1d70 into master Jan 9, 2016
@paulcsmith paulcsmith deleted the ps-66-quick-sequence branch January 9, 2016 18:24
@paulcsmith paulcsmith mentioned this pull request Jun 24, 2016
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