Module: Mailtrap::BaseAPI
- Included in:
- ContactFieldsAPI, ContactImportsAPI, ContactListsAPI, ContactsAPI, EmailTemplatesAPI, SuppressionsAPI
- Defined in:
- lib/mailtrap/base_api.rb
Defined Under Namespace
Modules: ClassMethods
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/mailtrap/base_api.rb', line 5 def account_id @account_id end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/mailtrap/base_api.rb', line 5 def client @client end |
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/mailtrap/base_api.rb', line 7 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#initialize(account_id = ENV.fetch('MAILTRAP_ACCOUNT_ID'), client = Mailtrap::Client.new) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/mailtrap/base_api.rb', line 18 def initialize(account_id = ENV.fetch('MAILTRAP_ACCOUNT_ID'), client = Mailtrap::Client.new) raise ArgumentError, 'account_id is required' if account_id.nil? @account_id = account_id @client = client end |