class MC2P::CRResource

Resource that allows send requests of create, list and detail

Public Class Methods

new(api_request, path, object_item_class) click to toggle source

Initializes a resource Params:

api_request

Api request used to make all the requests to the API

path

Path used to make all the requests to the API

object_item_class

Object item class used to return values

Calls superclass method MC2P::ReadOnlyResource::new
# File lib/base.rb, line 284
def initialize(api_request, path, object_item_class)
  super(api_request, path, object_item_class)
  @create_resource_mixin = CreateResourceMixin.new(api_request, path,
                                                   object_item_class,
                                                   @paginator_class)
end

Public Instance Methods

create(data) click to toggle source

Params:

data

data used on the request

Returns: an object item class with the response of the server

# File lib/base.rb, line 294
def create(data)
  @create_resource_mixin.create(data)
end