Class: Halchemy::HttpModel::Request
- Inherits:
-
Object
- Object
- Halchemy::HttpModel::Request
- Defined in:
- lib/halchemy/http_model.rb
Overview
Provides essential details about the request that was made which resulted in the Resource this is attached to
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(method, url, headers, body = nil) ⇒ Request
constructor
A new instance of Request.
- #to_s ⇒ Object
Constructor Details
#initialize(method, url, headers, body = nil) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 |
# File 'lib/halchemy/http_model.rb', line 12 def initialize(method, url, headers, body = nil) @method = method @url = url @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
10 11 12 |
# File 'lib/halchemy/http_model.rb', line 10 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
10 11 12 |
# File 'lib/halchemy/http_model.rb', line 10 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
10 11 12 |
# File 'lib/halchemy/http_model.rb', line 10 def method @method end |
#url ⇒ Object
Returns the value of attribute url.
10 11 12 |
# File 'lib/halchemy/http_model.rb', line 10 def url @url end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/halchemy/http_model.rb', line 19 def to_s "#{@method.to_s.upcase} #{@url}" end |