README.md in alba-3.4.0 vs README.md in alba-3.5.0
- old
+ new
@@ -684,11 +684,11 @@
```ruby
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
While Alba doesn't directly support multiple root keys, you can simulate it with `Alba.serialize`.
@@ -1154,10 +1154,10 @@
end
class UserResource
include Alba::Resource
- root_key!
+ root_key! # This is required to add inferred root key, otherwise it has no root key
attributes :id
many :articles
end