Class: SparkPost::Client
Instance Attribute Summary collapse
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#transmission ⇒ Object
readonly
Returns the value of attribute transmission.
Instance Method Summary collapse
-
#initialize(api_key = nil, api_host = 'https://api.sparkpost.com') ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key = nil, api_host = 'https://api.sparkpost.com') ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/sparkpost/client.rb', line 5 def initialize(api_key = nil, api_host = 'https://api.sparkpost.com') @api_key = (api_key || ENV['SPARKPOST_API_KEY']).to_s @api_host = (api_host || ENV['SPARKPOST_API_HOST']).to_s raise ArgumentError, 'No API key is provided. Either provide api_key with constructor or set SPARKPOST_API_KEY environment variable' if @api_key.blank? raise ArgumentError, 'No API host is provided. Either provide api_host with constructor or set SPARKPOST_API_HOST environment variable' if @api_host.blank? end |
Instance Attribute Details
#template ⇒ Object (readonly)
Returns the value of attribute template.
4 5 6 |
# File 'lib/sparkpost/client.rb', line 4 def template @template end |
#transmission ⇒ Object (readonly)
Returns the value of attribute transmission.
3 4 5 |
# File 'lib/sparkpost/client.rb', line 3 def transmission @transmission end |