Module: Constituencies
- Included in:
- TessituraRest
- Defined in:
- lib/tessitura_rest/crm/constituencies.rb
Instance Method Summary collapse
- #create_constituencies(constituency, id, options = {}) ⇒ Object
- #get_constituencies(id, options = {}) ⇒ Object
Instance Method Details
#create_constituencies(constituency, id, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/tessitura_rest/crm/constituencies.rb', line 8 def create_constituencies(constituency, id, = {}) parameters = { 'ConstituencyType': { 'Id': constituency, }, 'Constituent': { 'Id': id, }, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json) self.class.post(base_api_endpoint('CRM/Constituencies'), ) end |
#get_constituencies(id, options = {}) ⇒ Object
2 3 4 5 6 |
# File 'lib/tessitura_rest/crm/constituencies.rb', line 2 def get_constituencies(id, = {}) .merge!(basic_auth: @auth, headers: @headers) response = self.class.get(base_api_endpoint("CRM/Constituencies?constituentId=#{id}"), ) JSON.parse(response.body) end |