Class: CPEE::Callbacks

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/cpee/implementation.rb', line 86

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