class Starling::Services::AccountService

A service for accessing the Account API's Get Account endpoint

Public Instance Methods

balance() click to toggle source

@return [Services::AccountBalanceService] a configured service for accessing the

Account Balance API
# File lib/starling/services/account_service.rb, line 21
def balance
  Services::AccountBalanceService.new(api_service)
end
get(params: {}, headers: {}) click to toggle source

@param params [Hash] Parameters which will be included in the HTTP request,

included in the URL as a query string

@param headers [Hash] Headers which be included in the HTTP request, merged on

top of the headers set at the {Client} level

@return [Resources::AccountResource] @raise [Errors::ApiError] if the HTTP request returns a status indicating that it

was unsuccessful
# File lib/starling/services/account_service.rb, line 12
def get(params: {}, headers: {})
  response = api_service.make_request(:get, '/accounts', params: params,
                                                         headers: headers)

  resource.new(response: response)
end

Private Instance Methods

resource() click to toggle source
# File lib/starling/services/account_service.rb, line 27
def resource
  Resources::AccountResource
end