Module: Veeqo::SubresourceActions::ClassMethods
- Defined in:
- lib/veeqo/subresource_actions.rb
Instance Method Summary collapse
- #all(parent_id, params = {}) ⇒ Object
- #create(parent_id, params = {}) ⇒ Object
- #destroy(parent_id, resource_id, params = {}) ⇒ Object
- #destroy_all(parent_id, params = {}) ⇒ Object
- #find(parent_id, resource_id, params = {}) ⇒ Object
- #update(parent_id, resource_id, params = {}) ⇒ Object
Instance Method Details
#all(parent_id, params = {}) ⇒ Object
12 13 14 15 |
# File 'lib/veeqo/subresource_actions.rb', line 12 def all(parent_id, params = {}) raise ArgumentError if parent_id.nil? get path.build(parent_id), params end |
#create(parent_id, params = {}) ⇒ Object
22 23 24 25 |
# File 'lib/veeqo/subresource_actions.rb', line 22 def create(parent_id, params = {}) raise ArgumentError if parent_id.nil? post path.build(parent_id), params end |
#destroy(parent_id, resource_id, params = {}) ⇒ Object
32 33 34 35 |
# File 'lib/veeqo/subresource_actions.rb', line 32 def destroy(parent_id, resource_id, params = {}) raise ArgumentError if [parent_id, resource_id].any?(&:nil?) delete path.build([parent_id, resource_id]), params end |
#destroy_all(parent_id, params = {}) ⇒ Object
37 38 39 40 |
# File 'lib/veeqo/subresource_actions.rb', line 37 def destroy_all(parent_id, params = {}) raise ArgumentError if parent_id.nil? delete path.build(parent_id), params end |
#find(parent_id, resource_id, params = {}) ⇒ Object
17 18 19 20 |
# File 'lib/veeqo/subresource_actions.rb', line 17 def find(parent_id, resource_id, params = {}) raise ArgumentError if [parent_id, resource_id].any?(&:nil?) get path.build([parent_id, resource_id]), params end |
#update(parent_id, resource_id, params = {}) ⇒ Object
27 28 29 30 |
# File 'lib/veeqo/subresource_actions.rb', line 27 def update(parent_id, resource_id, params = {}) raise ArgumentError if [parent_id, resource_id].any?(&:nil?) put path.build([parent_id, resource_id]), params end |