Skip to content
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

Support for arrays nested in other array. #37

Closed
seban opened this issue Jan 2, 2014 · 5 comments
Closed

Support for arrays nested in other array. #37

seban opened this issue Jan 2, 2014 · 5 comments

Comments

@seban
Copy link

seban commented Jan 2, 2014

When I have need to use nested arrays in savon SOAP client, but this is case caused bug in my opinion.

irb(main):001:0> Gyoku::Array.to_xml([[{ value: "1" }]], "Map")
=> "<Map>[{:value=>\"1\"}]</Map>"

Nested array is treated with to_s method. IMO it could be treated as normal Array. I done some workaround in https://github.com/seban/gyoku/commit/e7706cfaea69bba655d30c49c1eabe6893bddc3d. After my fix it looks like:

2.0.0p247 :001 > Gyoku::Array.to_xml([[{ value: "1" }]], "Map")
 => "<Map><element><value>1</value></element></Map>"

If it is ok for you I can submit pull request.

@tjarratt
Copy link
Contributor

tjarratt commented Jan 2, 2014

@seban thanks for opening this issue. A pull request would be lovely! Do you think it would be possible to write some tests for this behavior?

@seban
Copy link
Author

seban commented Jan 2, 2014

@tjarratt I added tests to array_spec.rb isn't it enough?

@tjarratt
Copy link
Contributor

tjarratt commented Jan 2, 2014

Oh, I'm sorry. I hadn't noticed the linked commit in your first comment. That looks great!

Would you please issue a PR so we can get it merged in?

@tjarratt
Copy link
Contributor

tjarratt commented Jan 2, 2014

@seban I'll bump a new version of Gyoku later today and push it out to rubygems.org. In the meantime, I'm going to keep this issue open to remind myself to do that.

@tjarratt
Copy link
Contributor

tjarratt commented Jan 3, 2014

Just released version 1.1.1 with this change. Please let me know if you find any other problems @seban -- there were a few other changes since 1.1.0 was released in July.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants