class MailerLite::Client
Wrapper class for all actions.
Public Class Methods
new(options = {})
click to toggle source
Initialize client.
@param options [Hash] A customizable set of options. @option options [String] :api_key API Key provider from MailerLite
. @option options [String] :timeout optional open/read timeout Integer in
seconds
# File lib/mailerlite/client.rb, line 31 def initialize(options = {}) config.api_key = options[:api_key] if options[:api_key] config.timeout = options[:timeout] if options[:timeout] end
Public Instance Methods
config()
click to toggle source
@return [Configuration]
# File lib/mailerlite/client.rb, line 37 def config @config ||= Configuration.new end
Also aliased as: configuration
configure() { |config| ... }
click to toggle source
Configure client with a block of settings.
# File lib/mailerlite/client.rb, line 43 def configure yield(config) if block_given? true end
connection()
click to toggle source
@return [Connection]
# File lib/mailerlite/client.rb, line 49 def connection @connection ||= Connection.new(self) end