Skip to content

Commit e96f0b0

Browse files
committed
add docs about :only option
1 parent dbf3729 commit e96f0b0

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Changelog
22

3+
## v2.1.9
4+
5+
* Enhancements
6+
* Add `only` option to `include`
7+
38
## v2.1.8
49

510
* Enhancements

lib/construct.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,13 @@ defmodule Construct do
110110
@doc """
111111
Includes provided structure and checks definition for validity at compile-time.
112112
113+
## Options
114+
115+
* `:only` - (integer) specify fields that should be taken from included module,
116+
throws an error when field doesn't exist in provided module.
117+
113118
If included structure is invalid for some reason — this macro throws an
114-
`Struct.DefinitionError` exception with detailed reason.
119+
`Construct.DefinitionError` exception with detailed reason.
115120
"""
116121
@spec include(t, keyword) :: Macro.t()
117122
defmacro include(struct, opts \\ []) do

0 commit comments

Comments
 (0)