class Coyodlee::Facades::AccountsFacade

Public Class Methods

new(request_facade) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 4
def initialize(request_facade)
  @request_facade = request_facade
end

Public Instance Methods

add_manually(body:) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 33
def add_manually(body:)
  headers = { 'Accept' => 'application/json', 'Content-Type' => 'application/json' }
  req = @request_facade.build(:post, 'accounts', headers: headers, body: body.to_json)
  @request_facade.execute(req)
end
all() click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 8
def all
  headers = { 'Accept' => 'application/json' }
  req = @request_facade.build(:get, 'accounts', headers: headers)
  @request_facade.execute(req)
end
delete(account_id:) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 27
def delete(account_id:)
  headers = { 'Accept' => 'application/json' }
  req = @request_facade.build(:delete, "accounts/#{account_id}", headers: headers)
  @request_facade.execute(req)
end
details(account_id:, container:) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 14
def details(account_id:, container:)
  headers = { 'Accept' => 'application/json' }
  params = { 'container' => container }
  req = @request_facade.build(:get, "accounts/#{account_id}", params: params, headers: headers)
  @request_facade.execute(req)
end
historical_balances(params={}) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 45
def historical_balances(params={})
  headers = { 'Accept' => 'application/json' }
  req = @request_facade.build(:get, 'accounts/historicalBalances', headers: headers, params: params)
  @request_facade.execute(req)
end
investment_options(params={}) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 39
def investment_options(params={})
  headers = { 'Accept' => 'application/json' }
  req = @request_facade.build(:get, 'accounts/investmentPlan/investmentOptions', headers: headers, params: params)
  @request_facade.execute(req)
end
update(account_id:, body:) click to toggle source
# File lib/coyodlee/facades/accounts_facade.rb, line 21
def update(account_id:, body:)
  headers = { 'Accept' => 'application/json', 'Content-Type' => 'application/json' }
  req = @request_facade.build(:put, "accounts/#{account_id}", headers: headers, body: body.to_json)
  @request_facade.execute(req)
end