Module: RockRMS::Client::Group
- Included in:
- RockRMS::Client
- Defined in:
- lib/rock_rms/resources/group.rb
Instance Method Summary collapse
- #find_group(id) ⇒ Object
- #list_families_for_person(person_id, options = {}) ⇒ Object
- #list_groups(options = {}) ⇒ Object
- #list_groups_for_person(person_id, options = {}) ⇒ Object
-
#save_group_address(group_id:, location_type_id:, address:) ⇒ Object
address_format { street1:, street2:, city:, state:, postal_code:, country:, }.
Instance Method Details
#find_group(id) ⇒ Object
8 9 10 |
# File 'lib/rock_rms/resources/group.rb', line 8 def find_group(id) Response::Group.format(get(group_path(id))) end |
#list_families_for_person(person_id, options = {}) ⇒ Object
22 23 24 25 26 |
# File 'lib/rock_rms/resources/group.rb', line 22 def list_families_for_person(person_id, = {}) Response::Group.format( get("Groups/GetFamilies/#{person_id}", ) ) end |
#list_groups(options = {}) ⇒ Object
4 5 6 |
# File 'lib/rock_rms/resources/group.rb', line 4 def list_groups( = {}) Response::Group.format(get(group_path, )) end |
#list_groups_for_person(person_id, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/rock_rms/resources/group.rb', line 12 def list_groups_for_person(person_id, = {}) opts = .dup opts['$filter'] = Array(opts['$filter']) .push("Members/any(m: m/PersonId eq #{person_id})") .join(' and ') opts['$expand'] ||= 'Members' list_groups(opts) end |
#save_group_address(group_id:, location_type_id:, address:) ⇒ Object
address_format
street1:,
street2:,
city:,
state:,
postal_code:,
country:,
39 40 41 42 43 |
# File 'lib/rock_rms/resources/group.rb', line 39 def save_group_address(group_id:, location_type_id:, address:) url_params = TransformHashKeys.camelize_keys(address) put("Groups/SaveAddress/#{group_id}/#{location_type_id}?#{URI.encode_www_form(url_params)}") end |