Class: Sendgrid::Web::Client
- Inherits:
-
Object
- Object
- Sendgrid::Web::Client
- Defined in:
- lib/sendgrid/web/client.rb
Direct Known Subclasses
Blocks, Bounces, Credentials, FilterCommands, InvalidEmails, Mail
Defined Under Namespace
Classes: API
Class Method Summary collapse
-
.base_uri ⇒ Object
Returns the configured
root_url
. -
.config ⇒ Object
Retrieve the current global configuration object and if none exists, then create an empty one.
-
.configure(&block) ⇒ Sendgrid::Web::Configurator
Sets the global configuration object shared between all clients.
Instance Method Summary collapse
-
#config ⇒ Object
Retrieve the current global configuration object and if none exists, then create an empty one.
Class Method Details
.base_uri ⇒ Object
Returns the configured root_url
.
25 26 27 |
# File 'lib/sendgrid/web/client.rb', line 25 def self.base_uri config.root_url end |
.config ⇒ Object
Retrieve the current global configuration object and if none exists, then create an empty one.
20 21 22 |
# File 'lib/sendgrid/web/client.rb', line 20 def self.config @@config ||= Sendgrid::Web::Configurator.new end |
.configure(&block) ⇒ Sendgrid::Web::Configurator
Sets the global configuration object shared between all clients. You can use it like so:
Sendgrid::Web::Client.configure do |config|
config.username = 'foo'
config.password = 'bar'
end
12 13 14 |
# File 'lib/sendgrid/web/client.rb', line 12 def self.configure(&block) @@config = Sendgrid::Web::Configurator.new(&block) end |
Instance Method Details
#config ⇒ Object
Retrieve the current global configuration object and if none exists, then create an empty one.
33 34 35 |
# File 'lib/sendgrid/web/client.rb', line 33 def config @@config ||= Sendgrid::Web::Configurator.new end |