Class: Mailtrap::SubAccountsAPI
- Inherits:
-
Object
- Object
- Mailtrap::SubAccountsAPI
- Includes:
- BaseAPI
- Defined in:
- lib/mailtrap/sub_accounts_api.rb
Instance Attribute Summary collapse
-
#organization_id ⇒ Object
readonly
Returns the value of attribute organization_id.
Attributes included from BaseAPI
Instance Method Summary collapse
-
#create(options) ⇒ SubAccount
Creates a new sub account under the organization.
-
#initialize(organization_id, client = Mailtrap::Client.new) ⇒ SubAccountsAPI
constructor
A new instance of SubAccountsAPI.
-
#list ⇒ Array<SubAccount>
Lists all sub accounts under the organization.
Methods included from BaseAPI
Constructor Details
#initialize(organization_id, client = Mailtrap::Client.new) ⇒ SubAccountsAPI
Returns a new instance of SubAccountsAPI.
19 20 21 22 23 24 |
# File 'lib/mailtrap/sub_accounts_api.rb', line 19 def initialize(organization_id, client = Mailtrap::Client.new) raise ArgumentError, 'organization_id is required' if organization_id.nil? @organization_id = organization_id @client = client end |
Instance Attribute Details
#organization_id ⇒ Object (readonly)
Returns the value of attribute organization_id.
10 11 12 |
# File 'lib/mailtrap/sub_accounts_api.rb', line 10 def organization_id @organization_id end |
Instance Method Details
#create(options) ⇒ SubAccount
Creates a new sub account under the organization
39 40 41 |
# File 'lib/mailtrap/sub_accounts_api.rb', line 39 def create() base_create() end |
#list ⇒ Array<SubAccount>
Lists all sub accounts under the organization
29 30 31 |
# File 'lib/mailtrap/sub_accounts_api.rb', line 29 def list base_list end |