Skip to content

Commit

Permalink
Improve the documentation for StreamData.atom/1
Browse files Browse the repository at this point in the history
[ci skip]

Related to #114.
  • Loading branch information
whatyouhide committed Jan 8, 2019
1 parent dd95ec2 commit d5e1c43
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/stream_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,12 @@ defmodule StreamData do
* `:alias` - generates Elixir aliases like `Foo` or `Foo.Bar.Baz`.
These are the most common kinds of atoms usually used in Elixir applications. If you
need completely arbitrary atoms, you can use a combination of `map/2`, `String.to_atom/1`,
and string-focused generators to transform arbitrary strings into atoms:
printable_atom = StreamData.map(StreamData.string(:printable), &String.to_atom/1)
## Examples
Enum.take(StreamData.atom(:alphanumeric), 3)
Expand Down

0 comments on commit d5e1c43

Please sign in to comment.