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

SAVON 3 feature request: Add response.header method #544

Closed
ashrocket opened this issue Jan 25, 2014 · 2 comments
Closed

SAVON 3 feature request: Add response.header method #544

ashrocket opened this issue Jan 25, 2014 · 2 comments

Comments

@ashrocket
Copy link
Contributor

   def raw
      @raw_response
    end

    def header
      hash[:envelope][:header]
    end

    def body
      hash[:envelope][:body]
    end
    alias to_hash body

    def hash
      @hash ||= nori.parse(raw)
    end

If you can add an Rspec for response class, I can help adding in this method and appropriate rspec for it.

@rubiii rubiii mentioned this issue Jan 28, 2014
19 tasks
@tjarratt
Copy link
Contributor

Oh that's a fabulous idea, @ashrocket! I've added it to the list of features and fixes for Savon 3.

@ashrocket
Copy link
Contributor Author

I started to build a method missing implementation so you could do response.header.security. But realized too late that the nested nature of such data would required a copy of the recursive nested Ostruct solution and I didn't have time to examine this in detail.

The Ostruct solution is tested thoroughly so that's pretty safe, but I'm not sure about the nested version

Also we'd have to decide whether to return nil for missing elements or the standard method missing message

Ashley Raiteri

e: ashley@raiteri.net
p: 206.981.8060
github: ash_rocket
t: @ashr
l: linkedin.com/in/ashleyraiteri
b: http://ashley.raiteri.net

On Jan 27, 2014, at 10:25 PM, Tim Jarratt notifications@github.com wrote:

Oh that's a fabulous idea, @ashrocket! I've added it to the list of features and fixes for Savon 3.


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

2 participants