Class: CPEE::Callbacks

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/cpee/implementation.rb', line 119

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