Class: Makanai::Request
- Inherits:
-
Rack::Request
- Object
- Rack::Request
- Makanai::Request
- Defined in:
- lib/makanai/request.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#origin_body ⇒ Object
readonly
Returns the value of attribute origin_body.
-
#params ⇒ Object
Returns the value of attribute params.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(env) ⇒ Request
constructor
A new instance of Request.
- #root_url ⇒ Object
Constructor Details
#initialize(env) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 18 19 20 |
# File 'lib/makanai/request.rb', line 12 def initialize(env) super @env = env @url = build_url @origin_body = body&.read @query = parsed_url.query @params = build_params @method = build_method end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
9 10 11 |
# File 'lib/makanai/request.rb', line 9 def env @env end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
9 10 11 |
# File 'lib/makanai/request.rb', line 9 def method @method end |
#origin_body ⇒ Object (readonly)
Returns the value of attribute origin_body.
9 10 11 |
# File 'lib/makanai/request.rb', line 9 def origin_body @origin_body end |
#params ⇒ Object
Returns the value of attribute params.
10 11 12 |
# File 'lib/makanai/request.rb', line 10 def params @params end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
9 10 11 |
# File 'lib/makanai/request.rb', line 9 def query @query end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/makanai/request.rb', line 9 def url @url end |
Instance Method Details
#root_url ⇒ Object
22 23 24 |
# File 'lib/makanai/request.rb', line 22 def root_url @root_url ||= "#{parsed_url.scheme}://#{parsed_url.host}:#{parsed_url.port}" end |