Sha256: 6618ee019b6261a407e3f8b031bd95efe509603e0306dbc14cc7065d577f05e5

Contents?: true

Size: 973 Bytes

Versions: 1

Compression:

Stored size: 973 Bytes

Contents

# frozen_string_literal: true

module Crunchbase
  # Whole Searches endpoints
  module Searches
    # Send request for entities endpoints
    class Organization < Client
      include ::Crunchbase::Utilities::Request

      def endpoint
        ::Crunchbase::Models::Organization::RESOURCE_LIST
      end

      def query_conditions
        {
          "field_ids": field_ids,
          "order": orders,
          "query": conditions,
          "limit": LIMIT
        }
      end

      private

      def field_ids
        ::Crunchbase::Models::Organization.new.basis_fields
      end

      def orders
        [
          {
            "field_id": 'name',
            "sort": 'asc'
          }
        ]
      end

      def conditions
        [
          {
            "type": 'predicate',
            "field_id": @field,
            "operator_id": 'includes',
            "values": [
              @value
            ]
          }
        ]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crunchbase4-0.1.0 lib/crunchbase/searches/organization.rb