Class: Biryani::HTTP::Request
- Inherits:
-
Object
- Object
- Biryani::HTTP::Request
- Defined in:
- lib/biryani/http/request.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#method ⇒ Object
Returns the value of attribute method.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(method, uri, fields, content) ⇒ Request
constructor
A new instance of Request.
- #trailers ⇒ Array<String>?
Constructor Details
#initialize(method, uri, fields, content) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 |
# File 'lib/biryani/http/request.rb', line 10 def initialize(method, uri, fields, content) @method = method @uri = uri @fields = fields @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/biryani/http/request.rb', line 4 def content @content end |
#fields ⇒ Object
Returns the value of attribute fields.
4 5 6 |
# File 'lib/biryani/http/request.rb', line 4 def fields @fields end |
#method ⇒ Object
Returns the value of attribute method.
4 5 6 |
# File 'lib/biryani/http/request.rb', line 4 def method @method end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'lib/biryani/http/request.rb', line 4 def uri @uri end |
Instance Method Details
#trailers ⇒ Array<String>?
18 19 20 21 22 |
# File 'lib/biryani/http/request.rb', line 18 def trailers # https://datatracker.ietf.org/doc/html/rfc9110#section-6.6.2-4 keys = (@fields['trailer'] || []).flat_map { |x| x.split(',').map(&:strip) } @fields.slice(*keys) end |