class MC2P::ActionsResourceMixin

Allows send requests of actions

Public Instance Methods

_one_item_action(func, resource_id, action, data = nil) click to toggle source

Params:

func

function to make the request

resource_id

id to use on the requested url

action

action to use on the requested url

data

data passed in the request

Returns: response dictionary

# File lib/mixins.rb, line 318
def _one_item_action(func, resource_id, action, data = nil)
  url = detail_action_url(resource_id, action)
  @api_request.send(
    func,
    url,
    data,
    nil,
    self,
    resource_id
  )
end
detail_action_url(resource_id, action) click to toggle source

Params:

resource_id

id used on the url returned

action

action used on the url returned

Returns: url to make an action in an item

# File lib/mixins.rb, line 308
def detail_action_url(resource_id, action)
  "#{@path}#{resource_id}/#{action}/"
end