Class: SOAP::RPC::CGIStub::SOAPStdinRequest

Inherits:
SOAPRequest show all
Defined in:
lib/soap/rpc/cgistub.rb

Constant Summary

Constants inherited from SOAPRequest

SOAP::RPC::CGIStub::SOAPRequest::EMPTY_COOKIES

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ SOAPStdinRequest

Returns a new instance of SOAPStdinRequest.



48
49
50
51
# File 'lib/soap/rpc/cgistub.rb', line 48

def initialize(stream)
  size = ENV['CONTENT_LENGTH'].to_i || 0
  @body = stream.read(size)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



46
47
48
# File 'lib/soap/rpc/cgistub.rb', line 46

def body
  @body
end

Instance Method Details

#[](var) ⇒ Object



53
54
55
# File 'lib/soap/rpc/cgistub.rb', line 53

def [](var)
  ENV[var.gsub(/-/, '_').upcase]
end

#cookiesObject



63
64
65
66
67
68
69
# File 'lib/soap/rpc/cgistub.rb', line 63

def cookies
  if cookie = ENV['HTTP_Cookie'] || ENV['Cookie']
    [WEBrick::Cookie.parse(cookie)]
  else
    EMPTY_COOKIES
  end
end

#meta_varsObject



57
58
59
60
61
# File 'lib/soap/rpc/cgistub.rb', line 57

def meta_vars
  {
    'HTTP_SOAPACTION' => ENV['HTTP_SOAPAction']
  }
end

#userObject



71
72
73
# File 'lib/soap/rpc/cgistub.rb', line 71

def user
  ENV['REMOTE_USER']
end