Module: Bigcommerce::SubresourceActions::ClassMethods
- Defined in:
- lib/bigcommerce/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
14 15 16 17 18 |
# File 'lib/bigcommerce/subresource_actions.rb', line 14 def all(parent_id, params = {}) raise ArgumentError if parent_id.nil? get path.build(parent_id), params end |
#create(parent_id, params = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/bigcommerce/subresource_actions.rb', line 26 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
38 39 40 41 42 |
# File 'lib/bigcommerce/subresource_actions.rb', line 38 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
44 45 46 47 48 |
# File 'lib/bigcommerce/subresource_actions.rb', line 44 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
20 21 22 23 24 |
# File 'lib/bigcommerce/subresource_actions.rb', line 20 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
32 33 34 35 36 |
# File 'lib/bigcommerce/subresource_actions.rb', line 32 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 |