Sha256: 7c0025538c13723600d1d81103176ff314feb32729e991f21b4116996b116f98

Contents?: true

Size: 1.42 KB

Versions: 6

Compression:

Stored size: 1.42 KB

Contents

# 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
      class References < Base
        api_path "/references"

        class << self
          def contributors(contributor_names: nil, limit: 20, offset: 0)
            params = {
              contributor_names: contributor_names,
              limit:             limit,
              offset:            offset
            }.reject { |_, v| v.nil? }

            resp = send_get("contributors", params)

            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
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
oneaccess-1.2.0 lib/oneaccess/api/v3_0/references.rb
oneaccess-1.1.0 lib/oneaccess/api/v3_0/references.rb
oneaccess-1.0.1 lib/oneaccess/api/v3_0/references.rb
oneaccess-1.0.0 lib/oneaccess/api/v3_0/references.rb
oneaccess-0.5.0 lib/oneaccess/api/v3_0/references.rb
oneaccess-0.4.5 lib/oneaccess/api/v3_0/references.rb