Class: PostmarkClient::Client::Base Abstract
- Inherits:
-
Object
- Object
- PostmarkClient::Client::Base
- Defined in:
- lib/postmark_client/client/base.rb
Overview
This class is abstract.
Subclass and implement specific API resource methods
Base client class for all Postmark API interactions. Provides common HTTP functionality using Faraday.
Direct Known Subclasses
Constant Summary collapse
- API_BASE_URL =
Postmark API base URL
"https://api.postmarkapp.com"
Instance Attribute Summary collapse
-
#api_token ⇒ String
readonly
The API token for authentication.
-
#options ⇒ Hash
readonly
Additional options passed to the client.
Instance Method Summary collapse
-
#initialize(api_token: nil, **options) ⇒ Base
constructor
Initialize a new API client.
Constructor Details
#initialize(api_token: nil, **options) ⇒ Base
Initialize a new API client
39 40 41 42 43 44 |
# File 'lib/postmark_client/client/base.rb', line 39 def initialize(api_token: nil, **) @api_token = api_token || PostmarkClient.configuration.api_token @options = raise ConfigurationError, "API token is required" if @api_token.nil? || @api_token.empty? end |
Instance Attribute Details
#api_token ⇒ String (readonly)
Returns the API token for authentication.
24 25 26 |
# File 'lib/postmark_client/client/base.rb', line 24 def api_token @api_token end |
#options ⇒ Hash (readonly)
Returns additional options passed to the client.
27 28 29 |
# File 'lib/postmark_client/client/base.rb', line 27 def @options end |