-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework client and mail. Add response class
- Loading branch information
Showing
4 changed files
with
56 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'json' | ||
|
||
module SendGrid | ||
class Response | ||
attr_reader :code, :headers, :body, :raw_body | ||
|
||
def initialize(params) | ||
@code = params[:code] | ||
@headers = params[:headers] | ||
@body = JSON.parse(params[:body]) | ||
@raw_body = params[:body] | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require_relative 'sendgrid/client' | ||
require_relative 'sendgrid/exceptions' | ||
require_relative 'sendgrid/mail' | ||
require_relative 'sendgrid/response' | ||
require_relative 'sendgrid/version' |
230fdf5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 128: Should that
unless
beif
?As written, if I set
mail.to
, then line 128 changesmail.to
to bemail.from
.