-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
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
Nori converts String to Nori::StringWithAttributes #19
Comments
what's this test_id thing? can you reproduce the problem or create a gist for the soap response xml? |
I'm encountering this as well. It wouldn't seem like a problem, except It doesn't happen in all situations. I'll try to find a test case or something. |
Here's a relevant spec (currently fails): it "should be able to serialize and deserialize the hash to yaml losslessly" do
xml = <<-EOT
<product>
<item>1</item>
</product>
EOT
hash = parse(xml)
unserialized = YAML::load(YAML::dump(hash))
unserialized.should == hash
end |
This issue also exists when parsing an XML file. I created a Gist to demonstrate the problem. https://gist.github.com/3630294 |
This turned out not to be a bug in nori, and you can find the solution in the discussion on #24. I think this issue can probably be closed. |
yep. thanks! |
So yeah, this is an old issue, but I think it's coming up again in the latest version 2.5.1. The YAML.dump below gives me the same Nori::StringWithAttributes stuff mentioned in the first post.
|
@gnilrets would you mind opening a new issue for this behavior you described? If possible, could you provide a stand alone example? It's really hard to glean enough context from the snippet you posted to determine what's going on and to know how to start investigating. |
If i use savon for a soap call, i get a Hash with the response. In that hash i have Strings.
All Strings of the hash are from type Nori::StringWithAttributes instead String.
Only a result[:something].class shows that.
In my case i store the values in a Object wich i convert to yaml and this is the result:
test_id: !ruby/string:Nori::StringWithAttributes
str: '9482202'
attributes: {}
And a YAML.load(from_yaml) returns test_id = nil
@rubiii: if you need more input call me or weidenfreak ;)
cu
Jedbeard
The text was updated successfully, but these errors were encountered: