Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doitian/record_spec
Export record info for runtime
https://github.com/doitian/record_spec
Last synced: about 1 month ago
JSON representation
Export record info for runtime
- Host: GitHub
- URL: https://github.com/doitian/record_spec
- Owner: doitian
- Created: 2014-07-08T17:12:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-15T00:50:36.000Z (over 10 years ago)
- Last Synced: 2024-04-14T18:13:13.400Z (7 months ago)
- Language: Erlang
- Size: 160 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Record Spec
Generate record info for runtime.
## Usage
Add `record_spec` as a dependency in `rebar.config`.
{deps, [{record_spec, ".*", {git, "git://github.com/3pjgames/record_spec.git"}}]}.
Add following code to export records, e.g., `user` and `group`.
-include("record_spec/include/record_spec.hrl").
-export_record_spec([user, group]).See example below
```erlang
-module(models).
-include("record_spec/include/record_spec.hrl").
-record(user, { name :: binary(),
age :: integer() }).-record(group, { name :: binary(),
users :: [#user{}] }).-export_record_spec([user, group]).
```