Class: OpalRequest
- Inherits:
-
Object
- Object
- OpalRequest
- Defined in:
- lib/opal_loader/opal_request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#connection_host ⇒ Object
Returns the value of attribute connection_host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #headers ⇒ Object
-
#initialize(options = nil) ⇒ OpalRequest
constructor
A new instance of OpalRequest.
- #set_application(application) ⇒ Object
- #set_header(header, value, override = false) ⇒ Object
Constructor Details
#initialize(options = nil) ⇒ OpalRequest
Returns a new instance of OpalRequest.
8 9 10 11 12 |
# File 'lib/opal_loader/opal_request.rb', line 8 def initialize = nil @headers = {} parse_params() if end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/opal_loader/opal_request.rb', line 4 def body @body end |
#connection_host ⇒ Object
Returns the value of attribute connection_host.
6 7 8 |
# File 'lib/opal_loader/opal_request.rb', line 6 def connection_host @connection_host end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/opal_loader/opal_request.rb', line 5 def port @port end |
Instance Method Details
#headers ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/opal_loader/opal_request.rb', line 23 def headers tmp_headers = {} @headers.each do |header, value| tmp_headers[header] = value.join(';'); end tmp_headers end |
#set_application(application) ⇒ Object
19 20 21 |
# File 'lib/opal_loader/opal_request.rb', line 19 def set_application application set_header('x-onet-app', application, true) end |
#set_header(header, value, override = false) ⇒ Object
14 15 16 17 |
# File 'lib/opal_loader/opal_request.rb', line 14 def set_header header, value, override = false @headers[header] = [] if !@headers[header] || override @headers[header] << value end |