Skip to content

Commit

Permalink
[Doc] Mention why inline definition is not recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
okuramasafumi authored Dec 27, 2024
1 parent 8f8235e commit dfbd1b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ Alba.serialize(something)
# => Same as `FooResource.new(something).serialize` when `something` is an instance of `Foo`.
```

Although this might be useful sometimes, it's generally recommended to define a class for Resource.
Although this might be useful sometimes, it's generally recommended to define a class for Resource. Defining a class is often more readable and more maintainable, and inline definitions cannot levarage the benefit of YJIT (it's the slowest with the benchmark YJIT enabled).

#### Inline definition for multiple root keys

Expand Down

0 comments on commit dfbd1b6

Please sign in to comment.