Class: FriendlyShipping::Request
- Inherits:
-
Object
- Object
- FriendlyShipping::Request
- Defined in:
- lib/friendly_shipping/request.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url:, http_method: nil, body: nil, readable_body: nil, headers: {}, debug: false) ⇒ Request
constructor
A new instance of Request.
- #readable_body ⇒ Object
Constructor Details
#initialize(url:, http_method: nil, body: nil, readable_body: nil, headers: {}, debug: false) ⇒ Request
Returns a new instance of Request.
13 14 15 16 17 18 19 20 |
# File 'lib/friendly_shipping/request.rb', line 13 def initialize(url:, http_method: nil, body: nil, readable_body: nil, headers: {}, debug: false) @url = url @http_method = http_method @body = body @readable_body = readable_body @headers = headers @debug = debug end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/friendly_shipping/request.rb', line 5 def body @body end |
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
5 6 7 |
# File 'lib/friendly_shipping/request.rb', line 5 def debug @debug end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/friendly_shipping/request.rb', line 5 def headers @headers end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
5 6 7 |
# File 'lib/friendly_shipping/request.rb', line 5 def http_method @http_method end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/friendly_shipping/request.rb', line 5 def url @url end |
Instance Method Details
#readable_body ⇒ Object
22 23 24 |
# File 'lib/friendly_shipping/request.rb', line 22 def readable_body @readable_body.presence || @body end |