Class: SuperSendTX::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, base_url: HttpClient::DEFAULT_API_BASE_URL, transport: nil) ⇒ Client

Returns a new instance of Client.



7
8
9
10
11
12
13
14
15
# File 'lib/supersendtx/client.rb', line 7

def initialize(api_key, base_url: HttpClient::DEFAULT_API_BASE_URL, transport: nil)
  http = HttpClient.new(api_key, base_url: base_url, transport: transport)
  @emails = EmailsResource.new(http)
  @domains = DomainsResource.new(http)
  @webhooks = WebhooksResource.new(http)
  @templates = TemplatesResource.new(http)
  @suppressions = SuppressionsResource.new(http)
  @http = http
end

Instance Attribute Details

#domainsObject (readonly)

Returns the value of attribute domains.



5
6
7
# File 'lib/supersendtx/client.rb', line 5

def domains
  @domains
end

#emailsObject (readonly)

Returns the value of attribute emails.



5
6
7
# File 'lib/supersendtx/client.rb', line 5

def emails
  @emails
end

#suppressionsObject (readonly)

Returns the value of attribute suppressions.



5
6
7
# File 'lib/supersendtx/client.rb', line 5

def suppressions
  @suppressions
end

#templatesObject (readonly)

Returns the value of attribute templates.



5
6
7
# File 'lib/supersendtx/client.rb', line 5

def templates
  @templates
end

#webhooksObject (readonly)

Returns the value of attribute webhooks.



5
6
7
# File 'lib/supersendtx/client.rb', line 5

def webhooks
  @webhooks
end

Instance Method Details

#request(method, path, body: nil, headers: {}) ⇒ Object



17
18
19
# File 'lib/supersendtx/client.rb', line 17

def request(method, path, body: nil, headers: {})
  @http.request(method, path, body: body, headers: headers)
end