Skip to content

Commit 770580a

Browse files
committed
added heading
1 parent fb40385 commit 770580a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/syntax_and_semantics/modules.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Modules serve two purposes:
44

5-
* as namespaces for defining other types, methods and constants
6-
* as partial types that can be mixed in other types
5+
- as namespaces for defining other types, methods and constants
6+
- as partial types that can be mixed in other types
77

88
An example of a module as a namespace:
99

@@ -18,6 +18,8 @@ Curses::Window.new
1818

1919
Library authors are advised to put their definitions inside a module to avoid name clashes. The standard library usually doesn't have a namespace as its types and methods are very common, to avoid writing long names.
2020

21+
## `extend` and `include`
22+
2123
To use a module as a partial type you use `include` or `extend`.
2224

2325
An `include` makes a type include methods defined in that module as instance methods:

0 commit comments

Comments
 (0)