-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Sendgrid.api_key parameter to remove it from env.
- Loading branch information
Elodie Ailleaume
authored and
Elodie Ailleaume
committed
Mar 7, 2022
1 parent
709f84a
commit 4b4c9fd
Showing
5 changed files
with
26 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
module Sendgrid | ||
extend self | ||
|
||
def parameter(*names) | ||
names.each do |name| | ||
attr_accessor name | ||
|
||
define_method name do |*values| | ||
value = values.first | ||
value ? self.send("#{name}=", value) : instance_variable_get("@#{name}") | ||
end | ||
end | ||
end | ||
|
||
def config(&block) | ||
instance_eval &block | ||
end | ||
end | ||
|
||
Sendgrid.config do | ||
parameter :api_key | ||
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Sendgrid | ||
VERSION = "1.0.1" | ||
VERSION = "1.1.0" | ||
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