Doc Project v0.1.0 DocProject View Source

This is the main (and only) module for the doc project, which is intended to demonstrate documentation.

The documentation in this module will be used for generating HTML documentation. It will be formatted real nice and pretty with pleasing colors and links. Yeah, links! Pretty fancy stuff. All it needs now are some unicorns and rainbows, but we ran out.

Link to this section Summary


Converts an enumerable into string form

Sums the numbers in an enumerable

Link to this section Functions

Converts an enumerable into string form

The contents of the enumerable will be iterated over, converted to a string using Kernel.inspect/1 and put in a comma-separated list surrounded by brackets.


iex> DocProject.stringify([])
iex> DocProject.stringify(["a", "b", "c"])
"[\"a\", \"b\", \"c\"]"
iex> DocProject.stringify(1..10)
"[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"

Sums the numbers in an enumerable.

If the enumerable does not contain all numbers, then there will be trouble.


iex> DocProject.sum([1, 2, 3, 4, 5])
iex> DocProject.sum(1..10)
iex> DocProject.sum([22])
iex> DocProject.sum([])