Class: CPEE::Properties::PatchItems

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

Overview

}}}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.set(item, id, opts, xml) ⇒ Object



363
364
365
366
367
368
369
# File 'lib/cpee/implementation_properties.rb', line 363

def self::set(item, id, opts, xml)
  doc = XML::Smart::string(xml)
  val = doc.find("/*/*").map do |ele|
    [ele.qname.name, ele.text]
  end.to_h
  CPEE::Persistence::set_list(id,opts,item,val)
end

.set_hash(item, id, opts, val) ⇒ Object

{{{



360
361
362
# File 'lib/cpee/implementation_properties.rb', line 360

def self::set_hash(item, id, opts, val)
  CPEE::Persistence::set_list(id,opts,item,val)
end

Instance Method Details

#responseObject



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
# File 'lib/cpee/implementation_properties.rb', line 371

def response
  item = @a[0]
  id = @a[1]
  opts = @a[2]
  if opts[:statemachine].readonly? id
    @status = 423
  else
    begin
      PatchItems::set(item,id,opts,@p[0].value.read)
    rescue
      @status = 400
    end
  end
  nil
end