Skip to content

Commit 5775d49

Browse files
author
José Valim
committed
Merge pull request #1164 from sasa1977/document_record_features
documentation for record generated functions
2 parents 6397ced + ea79781 commit 5775d49

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/elixir/lib/kernel.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,13 @@ defmodule Kernel do
13791379
file_info = FileInfo.new(atime: now())
13801380
file_info.atime #=> Returns the value of atime
13811381
file_info.atime(now()) #=> Updates the value of atime
1382+
1383+
# Update multiple attributes at once:
1384+
file_info.update(atime: now(), accesses: 1)
1385+
1386+
# Obtain the keywords representation of a record:
1387+
file_info.to_keywords #=> [accesses: 1, atime: {1370,7171,911705}]
1388+
13821389
13831390
A record is simply a tuple where the first element is the record
13841391
module name. We can get the record raw representation as follow:

0 commit comments

Comments
 (0)