Sha256: df39a87f5d970b2b72f775d0c37ea5c421405e05c5d706901e97616edd2690d8

Contents?: true

Size: 535 Bytes

Versions: 1

Compression:

Stored size: 535 Bytes

Contents

require 'json'

# Search API

module FirstGiving

  class Search

    include Base

    module Actions
      LIST_ORGANIZATION = "/v1/list/organization"
    end

    def initialize
      @api_endpoint = SEARCH_ENDPOINT
    end

    def headers
      {'Accept' => 'application/json'}
    end

    def query(params)
      response = get_call(@api_endpoint, Actions::LIST_ORGANIZATION, params, headers)
      parse(response.body)
    end

    def parse(body)
      response = JSON.parse(body)
      response['payload']
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
firstgiving-1.0.0 lib/firstgiving/search.rb