Class: CPEE::Callbacks

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee/implementation.rb

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/cpee/implementation.rb', line 103

def response
  controller = @a[0]
  opts = @a[1]
  id = @r[0].to_i
  unless controller[id]
    @status = 400
    return
  end
  Riddl::Parameter::Complex.new("info","text/xml") do
    cb = XML::Smart::string("<callbacks details='#{opts[:mode]}'/>")
    if opts[:mode] == :debug
      controller[id].callbacks.each do |k,v|
        cb.root.add("callback",{"id" => k},"[#{v.protocol.to_s}] #{v.info}")
      end
    end
    cb.to_s
  end
end