Class: Dialed::HTTP::Request
- Inherits:
-
Object
- Object
- Dialed::HTTP::Request
- Defined in:
- lib/dialed/http/request.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #call(connection) ⇒ Object
-
#initialize(verb, path, *args, **options) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(verb, path, *args, **options) ⇒ Request
6 7 8 9 10 11 |
# File 'lib/dialed/http/request.rb', line 6 def initialize(verb, path, *args, **) @verb = verb @path = path @args = args @options = end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/dialed/http/request.rb', line 4 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/dialed/http/request.rb', line 4 def @options end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/dialed/http/request.rb', line 4 def path @path end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
4 5 6 |
# File 'lib/dialed/http/request.rb', line 4 def verb @verb end |
Instance Method Details
#call(connection) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dialed/http/request.rb', line 13 def call(connection) # protocol_request = Protocol::HTTP::Request[ # verb, # path, # *args, # version: connection.version, # headers: options[:headers], # method: verb.upcase, # authority: connection.authority, # scheme: connection.scheme, # ] protocol_request = Protocol::HTTP::Request.new.tap do |r| r.path = path r.method = verb.upcase r.headers = [:headers] if [:headers] r.version = connection.version r. = connection. r.scheme = connection.scheme r.body = [:body] r.protocol = [:protocol] if [:protocol] end protocol_request.call(connection) end |