Sha256: 91ea0f7b0155f9099ce2a78021bdf844c91f22fc1ef515d633b053039e73bf58
Contents?: true
Size: 981 Bytes
Versions: 2
Compression:
Stored size: 981 Bytes
Contents
require 'caseblocks_api' require 'active_support/inflector' module CaseblocksAPI class Finder def initialize(client) @client = client end def execute_single(case_type, property_name, value, page, page_size) @client.get("/case_blocks/#{case_type}/search", {query: {search: true, property: property_name, value: value, page: page, page_size: page_size}}) end def execute_multiple(case_type, properties, page, page_size) @client.post("/case_blocks/#{case_type}/search", :body => {search: true, properties: properties, page: page, page_size: page_size }.to_json) end end class Client def find_by_property(case_type, property_name, value, page, page_size) Finder.new(self.class).execute_single(case_type, property_name, value, page, page_size) end def find_by_properties(case_type, properties, page, page_size) Finder.new(self.class).execute_multiple(case_type, properties, page, page_size) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
caseblocks_api-0.2.12 | lib/caseblocks_api/finder.rb |
caseblocks_api-0.2.11 | lib/caseblocks_api/finder.rb |