Skip to content

Commit

Permalink
Fix doc formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 committed Sep 20, 2024
1 parent a2c0df2 commit 2a74b19
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions lib/money.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ defmodule Money do
* `{:ok, maximum_money}` or
* `{:error, reason}`
* `{:error, reason}`.
## Example
Expand Down Expand Up @@ -1414,22 +1414,21 @@ defmodule Money do

@doc """
Clamps a `t:Money.t/0` to be in the range of `minimum`
and `maximum`.
to `maximum`.
### Arguments
* `money`, `minimum` and `maximum` are any valid `t:Money.t/0` types returned
by `Money.new/2`. `They should be of the same
currency.
by `Money.new/2`. They should be of the same currency.
### Returns
* `{:ok, money]` where `money` is clamped to the minimum or maximum if required.
* `{:ok, money]` where `money` is clamped to the `minimum` or `maximum` if required.
* If `money` is within the range `minimum..maximum` then `money` is returned unchanged.
* If it is less than `minimum` then `minimum` is returned.
* If it is greater than `maximum` then `maximum` is returned.
* If `money` is less than `minimum` then `minimum` is returned.
* If `money` is greater than `maximum` then `maximum` is returned.
* or `{:error, {module, reason}}`.
* or `{:error, reason}`.
### Examples
Expand Down Expand Up @@ -1476,22 +1475,21 @@ defmodule Money do

@doc """
Clamps a `t:Money.t/0` to be in the range of `minimum`
and `maximum` or raises an exception.
to `maximum` or raises an exception.
### Arguments
* `money`, `minimum` and `maximum` are any valid `t:Money.t/0` types returned
by `Money.new/2`. `They should be of the same
currency.
by `Money.new/2`. They should be of the same currency.
### Returns
* `{:ok, money]` where `money` is clamped to the minimum or maximum if required.
* `money` where `money` is clamped to the `minimum` or `maximum` if required.
* If `money` is within the range `minimum..maximum` then `money` is returned unchanged.
* If it is less than `minimum` then `minimum` is returned.
* If it is greater than `maximum` then `maximum` is returned.
* If `money` is less than `minimum` then `minimum` is returned.
* If `money` is greater than `maximum` then `maximum` is returned.
* or `{:error, {module, reason}}`.
* or `{:error, reason}`.
### Examples
Expand Down Expand Up @@ -1541,12 +1539,11 @@ defmodule Money do
### Arguments
* `money`, `minimum` and `maximum` are any valid `t:Money.t/0` types returned
by `Money.new/2`. `They should be of the same
currency.
by `Money.new/2`. They should be of the same currency.
### Returns
* `true` or `false`
* `true` or `false`.
### Examples
Expand Down

0 comments on commit 2a74b19

Please sign in to comment.