class CPEE::Instances
Public Instance Methods
response()
click to toggle source
# File lib/cpee/implementation.rb, line 260 def response opts = @a[0] if opts[:see_instances] || @h['SEE_INSTANCES'] == 'true' Riddl::Parameter::Complex.new("wis","text/xml") do ins = XML::Smart::string('<instances/>') CPEE::Persistence::each_object(opts) do |instance| info = CPEE::Persistence::extract_item(instance,opts,'attributes/info') uuid = CPEE::Persistence::extract_item(instance,opts,'attributes/uuid') state = CPEE::Persistence::extract_item(instance,opts,'state') state_changed = CPEE::Persistence::extract_item(instance,opts,'state/@changed') ins.root.add('instance', info, 'uuid' => uuid, 'id' => instance, 'state' => state, 'state_changed' => state_changed ) end ins.to_s end else Riddl::Parameter::Complex.new("wis","text/xml",'<instances><!-- instances list disabled. --></instances>') end end