Tags:
Programming
Ruby on Rails
Anyway, I was using Ruby to send and receive the request, and I was getting a baffling SOAP::Mapping::Object object, and I had no idea how to use it. It's a class with dynamically generated methods, and none of the ones I was expecting to see were there. Blogosphere to the rescue! Marty Haught's Weblog gave a simple trick that saved the day and helped me narrow down my problem to let me see the solution within minutes. To inspect the resulting object, I was looking at the output of this: @results.public_methods.sort.join(' ')
Which gives a huge list of methods. Thanks to Marty, I did this instead: (@results.public_methods - Object.public_methods).sort.join(' ')
Subtracting Object.public_methods removes all the methods that all Ruby objects get, showing me only the methods that are different. I got this list: [] []= __add_xmlele_value __xmlattr __xmlele out out= Sure enough, the "out" method stood out, so I investigated it. A few minutes later, I had navigated through the class and found what I needed. Sweet! I post this here so that others might discover this simple trick and solve whatever problem is keeping them up late at night. |
About Me
![]()
![]() ![]() |
Be the first to post a comment:
Post a comment: