Sha256: dd9258e0766457a184c8412de9b7f949bc4cd4d4949cc0685bdecc7e026672ee

Contents?: true

Size: 520 Bytes

Versions: 8

Compression:

Stored size: 520 Bytes

Contents

require 'caseblocks_api'
require 'active_support/inflector'

module CaseblocksAPI
  class Searcher
    def initialize(client)
       @client = client
    end

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

  class Client
    def search(case_type, criteria, options={})
      Searcher.new(self.class).execute_search(case_type, criteria, options)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
caseblocks_api-0.2.20 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.19 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.18 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.17 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.16 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.15 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.14 lib/caseblocks_api/searcher.rb
caseblocks_api-0.2.13 lib/caseblocks_api/searcher.rb