Class: CPEE::Properties::DelItem

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation_properties.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/cpee/implementation_properties.rb', line 468

def response
  item = @a[0]
  id = @a[1]
  opts = @a[2]
  val = { @r.last => nil }
  if opts[:statemachine].readonly? id
    @status = 423
  else
    if CPEE::Persistence::extract_item(id,opts,@r.join('/'))
      CPEE::Persistence::set_list(id,opts,item,val,val.keys)
    else
      @status = 404
    end
  end
  nil
end