Module: Bigcommerce::ResourceActions::ClassMethods

Defined in:
lib/bigcommerce/resource_actions.rb

Instance Method Summary collapse

Instance Method Details

#all(params = {}) ⇒ Object


23
24
25
# File 'lib/bigcommerce/resource_actions.rb', line 23

def all(params = {})
  get path.build, params
end

#create(params = {}) ⇒ Object


32
33
34
# File 'lib/bigcommerce/resource_actions.rb', line 32

def create(params = {})
  post path.build, params
end

#destroy(resource_id, params = {}) ⇒ Object

Raises:

  • (ArgumentError)

41
42
43
44
# File 'lib/bigcommerce/resource_actions.rb', line 41

def destroy(resource_id, params = {})
  raise ArgumentError if resource_id.nil?
  delete path.build(resource_id), params
end

#destroy_all(params = {}) ⇒ Object


46
47
48
# File 'lib/bigcommerce/resource_actions.rb', line 46

def destroy_all(params = {})
  delete path.build, params
end

#find(resource_id, params = {}) ⇒ Object

Raises:

  • (ArgumentError)

27
28
29
30
# File 'lib/bigcommerce/resource_actions.rb', line 27

def find(resource_id, params = {})
  raise ArgumentError if resource_id.nil?
  get path.build(resource_id), params
end

#update(resource_id, params = {}) ⇒ Object

Raises:

  • (ArgumentError)

36
37
38
39
# File 'lib/bigcommerce/resource_actions.rb', line 36

def update(resource_id, params = {})
  raise ArgumentError if resource_id.nil?
  put path.build(resource_id), params
end