class MC2P::CreateObjectItemMixin

Allows create an object item

Public Instance Methods

_create() click to toggle source

Creates the object item with the json_dict data

# File lib/mixins.rb, line 55
def _create
  obj = @resource.create(
    @json_dict
  )
  @json_dict = obj.json_dict
end
save() click to toggle source

Executes the internal function _create if the object item don't have id

# File lib/mixins.rb, line 63
def save
  _create unless @json_dict.fetch(@id_property, false)
end