sendgrid-ruby
Advanced tools
@@ -37,2 +37,4 @@ # This configuration was generated by | ||
| Max: 2006 | ||
| Exclude: | ||
| - 'test/sendgrid/test_sendgrid-ruby.rb' | ||
@@ -39,0 +41,0 @@ # Offense count: 41 |
+6
-0
| # Change Log | ||
| All notable changes to this project will be documented in this file. | ||
| [2021-02-10] Version 6.4.0 | ||
| -------------------------- | ||
| **Library - Feature** | ||
| - [PR #455](https://github.com/sendgrid/sendgrid-ruby/pull/455): Add http_options as a param in the SendGrid::API's constructor. Thanks to [@hoangtuanictvn](https://github.com/hoangtuanictvn)! | ||
| [2021-01-27] Version 6.3.9 | ||
@@ -5,0 +11,0 @@ -------------------------- |
@@ -7,3 +7,3 @@ require 'ruby_http_client' | ||
| attr_accessor :client | ||
| attr_reader :request_headers, :host, :version, :impersonate_subuser | ||
| attr_reader :request_headers, :host, :version, :impersonate_subuser, :http_options | ||
@@ -18,4 +18,5 @@ # * *Args* : | ||
| # in the "On-Behalf-Of" header | ||
| # - +http_options+ -> http options that you want to be globally applied to each request | ||
| # | ||
| def initialize(auth:, host:, request_headers: nil, version: nil, impersonate_subuser: nil) | ||
| def initialize(auth:, host:, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {}) | ||
| @auth = auth | ||
@@ -36,5 +37,7 @@ @host = host | ||
| @request_headers = @request_headers.merge(request_headers) if request_headers | ||
| @http_options = http_options | ||
| @client = SendGrid::Client.new(host: "#{@host}/#{@version}", | ||
| request_headers: @request_headers) | ||
| request_headers: @request_headers, | ||
| http_options: @http_options) | ||
| end | ||
| end |
@@ -12,10 +12,11 @@ # Quickly and easily access the Twilio SendGrid API. | ||
| # in the "On-Behalf-Of" header | ||
| # - +http_options+ -> http options that you want to be globally applied to each request | ||
| # | ||
| def initialize(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil) | ||
| def initialize(api_key:, host: nil, request_headers: nil, version: nil, impersonate_subuser: nil, http_options: {}) | ||
| auth = "Bearer #{api_key}" | ||
| host ||= 'https://api.sendgrid.com' | ||
| super(auth: auth, host: host, request_headers: request_headers, version: version, impersonate_subuser: impersonate_subuser) | ||
| super(auth: auth, host: host, request_headers: request_headers, version: version, impersonate_subuser: impersonate_subuser, http_options: http_options) | ||
| end | ||
| end | ||
| end |
| module SendGrid | ||
| VERSION = '6.3.9'.freeze | ||
| VERSION = '6.4.0'.freeze | ||
| end |
Sorry, the diff of this file is too big to display