Module: CTAAggregatorClient::CTAResource
- Included in:
- AdvocacyCampaign, Event, Location, Target
- Defined in:
- lib/cta_aggregator_client/cta_resource.rb
Instance Method Summary collapse
- #create(attributes) ⇒ Object
- #delete(uuid) ⇒ Object
- #find(uuid) ⇒ Object
- #list(filters = {}) ⇒ Object
- #relationships ⇒ Object
- #resource_name ⇒ Object
- #update(attributes) ⇒ Object
Instance Method Details
#create(attributes) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 14 def create(attributes) if relationships relationship_data = { relationships => attributes.delete(relationships) } end API::Client.create(resource_name, attributes, relationship_data) end |
#delete(uuid) ⇒ Object
27 28 29 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 27 def delete(uuid) API::Client.delete(resource_name, uuid) end |
#find(uuid) ⇒ Object
10 11 12 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 10 def find(uuid) API::Client.find(resource_name, uuid) end |
#list(filters = {}) ⇒ Object
6 7 8 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 6 def list(filters = {}) API::Client.list(resource_name, filters) end |
#relationships ⇒ Object
35 36 37 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 35 def relationships nil end |
#resource_name ⇒ Object
31 32 33 |
# File 'lib/cta_aggregator_client/cta_resource.rb', line 31 def resource_name raise NotImplementedError end |