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 <<-END
      <subscriptions xmlns='http://riddl.org/ns/common-patterns/notifications-producer/2.0'/>
    END
    CPEE::Persistence::extract_handlers(id,opts).each do |de|
      ret.root.add('subscription').tap do |n|
        n.attributes['id'] = de[0]
        n.attributes['url'] = de[1] if de[1] && !de[1].empty?
      end
    end
    ret.to_s
  end
end