Class: LemonwayOnboarding::Api::Accounts
- Inherits:
-
Object
- Object
- LemonwayOnboarding::Api::Accounts
- Defined in:
- lib/lemonway_onboarding/api/accounts.rb
Overview
Accounts API for Lemonway Onboarding
Instance Method Summary collapse
-
#create(type, body) ⇒ Hash
Creates a new account.
-
#index(params = {}) ⇒ Array<Hash>
Lists all accounts.
-
#initialize(client = LemonwayOnboarding::Client.new) ⇒ LemonwayOnboarding::Api::Accounts
constructor
Initializes the Accounts API with a client.
-
#show(id) ⇒ Hash
Retrieves a specific account by its ID.
Constructor Details
#initialize(client = LemonwayOnboarding::Client.new) ⇒ LemonwayOnboarding::Api::Accounts
Initializes the Accounts API with a client.
11 12 13 |
# File 'lib/lemonway_onboarding/api/accounts.rb', line 11 def initialize(client = LemonwayOnboarding::Client.new) @client = client end |
Instance Method Details
#create(type, body) ⇒ Hash
Creates a new account.
20 21 22 |
# File 'lib/lemonway_onboarding/api/accounts.rb', line 20 def create(type, body) @client.post("accounts/#{type}", body) end |
#index(params = {}) ⇒ Array<Hash>
Lists all accounts.
28 29 30 |
# File 'lib/lemonway_onboarding/api/accounts.rb', line 28 def index(params = {}) @client.get('accounts', params) end |
#show(id) ⇒ Hash
Retrieves a specific account by its ID.
36 37 38 |
# File 'lib/lemonway_onboarding/api/accounts.rb', line 36 def show(id) @client.get("accounts/#{id}") end |