Class: ChurchCommunityBuilder::Search
- Inherits:
-
Object
- Object
- ChurchCommunityBuilder::Search
- Defined in:
- lib/api/search.rb
Class Method Summary collapse
-
.all_individual_profiles ⇒ Object
Returns a list of all individual profiles in the Church Community Builder system.
-
.search_for_all_campuses ⇒ Object
This is currently undocumented, but found via spelunking.
-
.search_for_all_funds ⇒ Object
This is currently undocumented, but found via spelunking.
-
.search_for_all_valid_individuals ⇒ Object
Returns a list of all individuals in the Church Community Builder system.
-
.search_for_batch_by_date(modified_since = nil) ⇒ Object
Leaving ‘modified_since’ as ‘nil’ will return all batches in the system.
-
.search_for_batch_by_date_range(start_date, end_date = nil) ⇒ Object
Returns a BatchList of all batches posted in specified date range.
- .search_for_batch_by_id(batch_id) ⇒ Object
-
.search_for_person_by_name(last_name = nil, first_name = nil) ⇒ Object
Search CCB for individuals based off of the search parameters Note: Searches are performed as a LIKE query in the CCB database.
Class Method Details
.all_individual_profiles ⇒ Object
Returns a list of all individual profiles in the Church Community Builder system.
6 7 8 9 10 |
# File 'lib/api/search.rb', line 6 def self.all_individual_profiles = {url_data_params: {srv: 'individual_profiles'}} reader = IndividualListReader.new() IndividualList.new(reader.load_feed) end |
.search_for_all_campuses ⇒ Object
This is currently undocumented, but found via spelunking
65 66 67 68 69 |
# File 'lib/api/search.rb', line 65 def self.search_for_all_campuses = {url_data_params: {srv: 'campus_list'}} reader = CampusListReader.new() CampusList.new(reader.load_feed) end |
.search_for_all_funds ⇒ Object
This is currently undocumented, but found via spelunking
73 74 75 76 |
# File 'lib/api/search.rb', line 73 def self.search_for_all_funds reader = FundListReader.new FundList.new(reader.load_feed) end |
.search_for_all_valid_individuals ⇒ Object
Returns a list of all individuals in the Church Community Builder system.
24 25 26 27 28 |
# File 'lib/api/search.rb', line 24 def self.search_for_all_valid_individuals = {url_data_params: {srv: 'valid_individuals'}} reader = IndividualListReader.new() ValidIndividualList.new(reader.load_feed) end |
.search_for_batch_by_date(modified_since = nil) ⇒ Object
Leaving ‘modified_since’ as ‘nil’ will return all batches in the system.
Specifying a date will return all batches created or modified since that date.
Date format should be YYYY-MM-DD
37 38 39 40 41 |
# File 'lib/api/search.rb', line 37 def self.search_for_batch_by_date(modified_since = nil) = {url_data_params: {srv: 'batch_profiles', modified_since: modified_since} } reader = BatchListReader.new() BatchList.new(reader.load_feed) end |
.search_for_batch_by_date_range(start_date, end_date = nil) ⇒ Object
Returns a BatchList of all batches posted in specified date range. End date is optional.
Date format should be YYYY-MM-DD
47 48 49 50 51 52 |
# File 'lib/api/search.rb', line 47 def self.search_for_batch_by_date_range(start_date, end_date = nil) = {url_data_params: {srv: 'batch_profiles_in_date_range', date_start: start_date, date_end: end_date}} [:url_data_params].delete(:date_end) if end_date.nil? reader = BatchListReader.new() BatchList.new(reader.load_feed) end |
.search_for_batch_by_id(batch_id) ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'lib/api/search.rb', line 54 def self.search_for_batch_by_id(batch_id) # options = {:url_data_params => {srv: "batch_profile_from_id", # id: batch_id # } # } reader = BatchReader.new(batch_id) Batch.new(reader.load_feed) end |
.search_for_person_by_name(last_name = nil, first_name = nil) ⇒ Object
Search CCB for individuals based off of the search parameters Note: Searches are performed as a LIKE query in the CCB database. If the value provided for the criterion is found anywhere in the field, it will be considered a match.
17 18 19 20 21 |
# File 'lib/api/search.rb', line 17 def self.search_for_person_by_name(last_name = nil,first_name = nil) = {url_data_params: {srv: 'individual_search', last_name: last_name, first_name: first_name}} reader = IndividualListReader.new() IndividualList.new(reader.load_feed) end |