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

{{{



506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
# File 'lib/cpee/implementation_properties.rb', line 506

def response
  item = @a[0]
  id = @a[1]
  opts = @a[2]
  val = { @r.last => nil }
  if opts[:statemachine].readonly? id
    @status = 423
  elsif opts[:statemachine].final? id
    @status = 410
  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