We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would often like to create a Pb object from a hash object. But a hash object does not allow dot access.
dot access
Add an argument to specify the access policy which uses dot access or symbol access. That uses OpenStruct internally.
symbol access
OpenStruct
e.g.
UserPbSerializer.new({ id: 1234, name: "John Smith" }, use_symbol_access: true)
alternatives Wrap an object by OpenStruct before giving it to the initializer.
UserPbSerializer.new(OpenStruct.new({ id: 1234, name: `John Smith`, }))
I'm using this solution temporarily, but it's a little complicated :(
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Why
I would often like to create a Pb object from a hash object.
But a hash object does not allow
dot access
.What
Add an argument to specify the access policy which uses
dot access
orsymbol access
. That usesOpenStruct
internally.e.g.
alternatives
Wrap an object by
OpenStruct
before giving it to the initializer.e.g.
I'm using this solution temporarily, but it's a little complicated :(
The text was updated successfully, but these errors were encountered: