Class: Requester::Request
- Inherits:
-
Object
- Object
- Requester::Request
- Defined in:
- lib/requester/request.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(request) ⇒ Request
constructor
A new instance of Request.
- #json ⇒ Object
Constructor Details
Class Method Details
.generate(request) ⇒ Object
5 6 7 |
# File 'lib/requester/request.rb', line 5 def self.generate(request) new(request).json end |
Instance Method Details
#json ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/requester/request.rb', line 18 def json @json.tap do |json| json[:request_parameters] = @request.request_parameters if @request.request_parameters json[:query_string] = @request.query_string if @request.query_string json[:media_type] = @request.media_type if @request.media_type Requester::Config.additional_request_attributes.each do |attr| json[attr] = @request.public_send(attr) end end end |