Class: CaseblocksAPI::Searcher

Inherits:
Object
  • Object
show all
Defined in:
lib/caseblocks_api/searcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Searcher

Returns a new instance of Searcher.



6
7
8
# File 'lib/caseblocks_api/searcher.rb', line 6

def initialize(client)
   @client = client
end

Instance Method Details

#execute_search(case_type, criteria, options = {}) ⇒ Object



10
11
12
13
# File 'lib/caseblocks_api/searcher.rb', line 10

def execute_search(case_type, criteria, options={})
    body = {properties: criteria}.merge(options).to_json
    @client.post("/case_blocks/#{case_type}/search", :body => body)
end