Class: MC2P::ReadOnlyResource

Inherits:
DetailOnlyResource show all
Defined in:
lib/base.rb

Overview

Resource that allows send requests of list and detail

Instance Method Summary collapse

Methods inherited from DetailOnlyResource

#detail

Methods inherited from ResourceMixin

#_one_item, #detail_url

Constructor Details

#initialize(api_request, path, object_item_class) ⇒ ReadOnlyResource

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



262
263
264
265
266
267
# File 'lib/base.rb', line 262

def initialize(api_request, path, object_item_class)
  super(api_request, path, object_item_class)
  @ro_resource_mixin = ReadOnlyResourceMixin.new(api_request, path,
                                                 object_item_class,
                                                 @paginator_class)
end

Instance Method Details

#list(abs_url = nil) ⇒ Object

Params:

abs_url

if is passed the request is sent to this url

Returns: a paginator class with the response of the server



272
273
274
# File 'lib/base.rb', line 272

def list(abs_url = nil)
  @ro_resource_mixin.list(abs_url)
end