Class: MC2P::CRUDObjectItem
- Inherits:
-
CRUObjectItem
- Object
- ObjectItemMixin
- ObjectItem
- ReadOnlyObjectItem
- CRUObjectItem
- MC2P::CRUDObjectItem
- Defined in:
- lib/base.rb
Overview
Object item that allows retrieve, create, change and delete an item
Instance Attribute Summary
Attributes inherited from ObjectItemMixin
#_deleted, #json_dict, #resource
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes the object item.
-
#initialize(json_dict, resource) ⇒ CRUDObjectItem
constructor
- Initializes an object item Params:
json_dict
- Data of the object
resource
-
Resource used to delete, save, create or retrieve the object.
- Data of the object
- Initializes an object item Params:
Methods inherited from CRUObjectItem
Methods inherited from ReadOnlyObjectItem
Methods inherited from ObjectItem
#method_missing, #respond_to?, #respond_to_missing?, #set
Methods inherited from ObjectItemMixin
#id_required_and_not_deleted, #to_s
Constructor Details
#initialize(json_dict, resource) ⇒ CRUDObjectItem
Initializes an object item Params:
json_dict
-
Data of the object
resource
-
Resource used to delete, save, create or retrieve the object
178 179 180 181 |
# File 'lib/base.rb', line 178 def initialize(json_dict, resource) @delete_mixin = DeleteObjectItemMixin.new(json_dict, resource) super(json_dict, resource) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class MC2P::ObjectItem
Instance Method Details
#delete ⇒ Object
Deletes the object item
184 185 186 187 188 189 190 |
# File 'lib/base.rb', line 184 def delete @delete_mixin.json_dict = @json_dict @delete_mixin._deleted = @_deleted @delete_mixin.delete @json_dict = @delete_mixin.json_dict @_deleted = @delete_mixin._deleted end |