Class: FundAmerica::Investor

Inherits:
Object
  • Object
show all
Defined in:
lib/fund_america/investor.rb

Class Method Summary collapse

Class Method Details

.create(options) ⇒ Object

End point: apps.fundamerica.com/api/investors (POST) Usage: FundAmerica::Investor.create(options) Output: Creates a new investor - proxy, joint, ira



15
16
17
# File 'lib/fund_america/investor.rb', line 15

def create(options)
  API::request(:post, 'investors', options)
end

.details(investor_id) ⇒ Object

End point: apps.fundamerica.com/api/entities/:id (GET) Usage: FundAmerica::Investor.details(entity_id) Output: Returns the details of an investor with matching id



31
32
33
# File 'lib/fund_america/investor.rb', line 31

def details(investor_id)
  API::request(:get, "investors/#{investor_id}")
end

.listObject

End point: apps.fundamerica.com/api/investors (GET) Usage: FundAmerica::Investor.list Output: Returns list of investors



8
9
10
# File 'lib/fund_america/investor.rb', line 8

def list
  API::request(:get, 'investors')
end

.update(investor_id, options) ⇒ Object

End point: apps.fundamerica.com/api/investors/:id (PATCH) Usage: FundAmerica::Investor.update(entity_id, options) Output: Updates an investor - proxy, joint, irc Uses test_mode update when used in sandbox mode



23
24
25
26
# File 'lib/fund_america/investor.rb', line 23

def update(investor_id, options)
  end_point_url = FundAmerica.base_uri + "#{FundAmerica.mode == 'sandbox' ? 'test_mode/' : ''}" + "investors/#{investor_id}"
  API::request(:patch, end_point_url, options)
end