class CPEE::Properties::PutItems

Public Class Methods

set(item,id,opts,xml) click to toggle source
# File lib/cpee/implementation_properties.rb, line 383
def self::set(item,id,opts,xml)
  doc = XML::Smart::string(xml)
  val = {}
  doc.find("/*/*").each do |ele|
    val[ele.qname.name] = ele.text unless val.has_key?(ele.qname.name)
  end
  oldkeys = CPEE::Persistence::extract_list(id,opts,item).to_h.keys
  newkeys = val.keys
  del = oldkeys - newkeys
  CPEE::Persistence::set_list(id,opts,item,val,del)
end

Public Instance Methods

response() click to toggle source
# File lib/cpee/implementation_properties.rb, line 395
def response
  item = @a[0]
  id = @a[1]
  opts = @a[2]
  if opts[:statemachine].readonly? id
    @status = 423
  else
    begin
      PutItems::set(item,id,opts,@p[0].value.read)
    rescue
      @status = 400
    end
  end
  nil
end