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
Hey there,
i have some trouble with the property/attribute option. For example:
<foo> <bar /> </foo>
instead of the expected one:
<foo> <bar title="this is my title" /> </foo>
and a mapping like this:
nested 'foo' nested 'bar' do property 'title', attribute: true, setter: ->(fragment:, represented:, **) { ... } end end end
With this i get an Error NoMethodError: undefined method `title=' for #<Hash:0x00000006df7590>. I can solve this by adding a reader and skip_parse:
NoMethodError: undefined method `title=' for #<Hash:0x00000006df7590>
nested 'foo' nested 'bar' do property 'title', attribute: true, reader: ->(doc:, **){ doc[:title] || ''}, skip_parse: fragment_empty, setter: ->(fragment:, represented:, **) { ... } end end end
Isn't there a way to skip this by default? If the attribute does not exists just skip instead of the exception?
Any ideas?
The text was updated successfully, but these errors were encountered:
Can you check if that problem persists with Representable::Hash instead of XML? Looks to me like an XML problem.
Representable::Hash
XML
Sorry, something went wrong.
No branches or pull requests
Hey there,
i have some trouble with the property/attribute option. For example:
instead of the expected one:
and a mapping like this:
With this i get an Error
NoMethodError: undefined method `title=' for #<Hash:0x00000006df7590>
. I can solve this by adding a reader and skip_parse:Isn't there a way to skip this by default? If the attribute does not exists just skip instead of the exception?
Any ideas?
The text was updated successfully, but these errors were encountered: