lib/oneaccess/api/v3_0/references.rb in oneaccess-0.2.0 vs lib/oneaccess/api/v3_0/references.rb in oneaccess-0.3.0

- old
+ new

@@ -1,9 +1,11 @@ # frozen_string_literal: true require_relative "../../response/contributors_response" +require_relative "../../response/investors_response" require_relative "../../request/contributors_request_handler" +require_relative "../../request/investors_request_handler" module ONEAccess module API module V3_0 # rubocop:disable Style/ClassAndModuleCamelCase class References < Base @@ -22,9 +24,25 @@ Response::ContributorsResponse.from_json(resp.body) end def contributors_list Request::ContributorsRequestHandler.new(url: api_url("contributors")) + end + + def investors(investor_names: nil, limit: 20, offset: 0) + params = { + investor_names: investor_names, + limit: limit, + offset: offset + }.reject { |_, v| v.nil? } + + resp = send_get("investors", params) + + Response::InvestorsResponse.from_json(resp.body) + end + + def investors_list + Request::InvestorsRequestHandler.new(url: api_url("investors")) end end end end end