class Riddl::Utils::Properties::Properties

Public Instance Methods

response() click to toggle source
# File lib/ruby/riddl/utils/properties.rb, line 152
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