Class: Riddl::Utils::Properties::Properties

Inherits:
Implementation show all
Defined in:
lib/ruby/riddl/utils/properties.rb

Overview

}}}

Instance Method Summary collapse

Methods inherited from Implementation

#headers, #initialize, #status

Constructor Details

This class inherits a constructor from Riddl::Implementation

Instance Method Details

#responseObject

{{{



151
152
153
154
155
156
157
158
159
160
161
# File 'lib/ruby/riddl/utils/properties.rb', line 151

def response
  backend = @a[0]
  handler = @a[1]
  EM.defer{handler.read} unless handler.nil?

  ret = XML::Smart.string("<properties xmlns=\"http://riddl.org/ns/common-patterns/properties/1.0\"/>")
  backend.schema.find("/p:properties/*[name()!='optional']|/p:properties/p:optional/*").each do |r|
    ret.root.add("property",r.qname.to_s)
  end
  return Riddl::Parameter::Complex.new("keys","text/xml",ret.to_s)
end