Class: CPEE::Notifications::Subscriptions

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/cpee/implementation_notifications.rb', line 72

def response
  id = @a[0]
  opts = @a[1]
  Riddl::Parameter::Complex.new("subscriptions","text/xml") do
    ret = XML::Smart::string "      <subscriptions xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'/>\n    END\n    CPEE::Persistence::extract_handlers(id,opts).each do |de|\n      ret.root.add('subscription').tap do |n|\n        n.attributes['id'] = de[0]\n        n.attributes['url'] = de[1] if de[1] && !de[1].empty?\n      end\n    end\n    ret.to_s\n  end\nend\n"