Class: CPEE::Properties::PutStatus

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(id, opts, xml) ⇒ Object

{{{



293
294
295
296
297
# File 'lib/cpee/implementation_properties.rb', line 293

def self::set(id,opts,xml)
  doc = XML::Smart::string(xml)
  doc.register_namespace 'p', 'http://cpee.org/ns/properties/2.0'
  CPEE::Persistence::set_item(id,opts,'status',:id => doc.find('string(/p:status/p:id)').to_i, :message => doc.find('string(/p:status/p:message)'))
end

Instance Method Details

#responseObject



299
300
301
302
303
304
305
306
307
308
# File 'lib/cpee/implementation_properties.rb', line 299

def response
  id = @a[0]
  opts = @a[1]
  if opts[:statemachine].readonly? id
    @status = 422 # semantic error
  else
    PutStatus::set id, opts, @p[0].value.read
  end
  nil
end