Class: Sendgrid::Web::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/web/client.rb

Defined Under Namespace

Classes: API

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.base_uriObject

Returns the configured root_url.



25
26
27
# File 'lib/sendgrid/web/client.rb', line 25

def self.base_uri
  config.root_url
end

.configObject

Retrieve the current global configuration object and if none exists, then create an empty one.

See Also:



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

#configObject

Retrieve the current global configuration object and if none exists, then create an empty one.

See Also:



33
34
35
# File 'lib/sendgrid/web/client.rb', line 33

def config
  @@config ||= Sendgrid::Web::Configurator.new
end