Module: PanlexClient

Defined in:
lib/panlex_client/panlex_client.rb

Overview

panlex_client namespace

Constant Summary collapse

API_URL =

PanLex public API URL

'http://api.panlex.org/'

Class Method Summary collapse

Class Method Details

.query(param, body) {|response, request, result| ... } ⇒ Object

Send a request to PanLex API.

Parameters:

Yield Parameters:

  • response (String)

    The response from PanLex, a string you can parse to JSON

  • request (RestClient::Request)
  • result (Net::HTTPOK)


13
14
15
# File 'lib/panlex_client/panlex_client.rb', line 13

def self.query(param, body, &block)
   RestClient.post API_URL+param, body.to_json, { :content_type => :json, :accept => :json }, &block
end