Class: SuperSendTX::Client
- Inherits:
-
Object
- Object
- SuperSendTX::Client
- Defined in:
- lib/supersendtx/client.rb
Instance Attribute Summary collapse
-
#domains ⇒ Object
readonly
Returns the value of attribute domains.
-
#emails ⇒ Object
readonly
Returns the value of attribute emails.
-
#suppressions ⇒ Object
readonly
Returns the value of attribute suppressions.
-
#templates ⇒ Object
readonly
Returns the value of attribute templates.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
Instance Method Summary collapse
-
#initialize(api_key, base_url: HttpClient::DEFAULT_API_BASE_URL, transport: nil) ⇒ Client
constructor
A new instance of Client.
- #request(method, path, body: nil, headers: {}) ⇒ Object
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
#domains ⇒ Object (readonly)
Returns the value of attribute domains.
5 6 7 |
# File 'lib/supersendtx/client.rb', line 5 def domains @domains end |
#emails ⇒ Object (readonly)
Returns the value of attribute emails.
5 6 7 |
# File 'lib/supersendtx/client.rb', line 5 def emails @emails end |
#suppressions ⇒ Object (readonly)
Returns the value of attribute suppressions.
5 6 7 |
# File 'lib/supersendtx/client.rb', line 5 def suppressions @suppressions end |
#templates ⇒ Object (readonly)
Returns the value of attribute templates.
5 6 7 |
# File 'lib/supersendtx/client.rb', line 5 def templates @templates end |
#webhooks ⇒ Object (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 |