Class: MLB::RequestBuilder
- Inherits:
-
Object
- Object
- MLB::RequestBuilder
- Defined in:
- lib/mlb/request_builder.rb
Constant Summary collapse
- DEFAULT_HEADERS =
{ "Content-Type" => "application/json; charset=utf-8", "User-Agent" => "MLB-Client/#{VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION} (#{RUBY_PLATFORM})" }.freeze
- HTTP_METHODS =
{ get: Net::HTTP::Get, post: Net::HTTP::Post, put: Net::HTTP::Put, delete: Net::HTTP::Delete }.freeze
Instance Method Summary collapse
Instance Method Details
#build(http_method:, uri:, body: nil, headers: {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/mlb/request_builder.rb', line 18 def build(http_method:, uri:, body: nil, headers: {}) request = create_request(http_method:, uri:, body:) add_headers(request:, headers:) request end |