Module: CPEE::Notifications

Defined in:
lib/cpee/implementation_notifications.rb

Defined Under Namespace

Classes: CreateSubscription, DeleteSubscription, Overview, SSE, Subscription, Subscriptions, Topics, UpdateSubscription

Class Method Summary collapse

Class Method Details

.implementation(id, opts) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cpee/implementation_notifications.rb', line 6

def self::implementation(id,opts)
  Proc.new do
    on resource "notifications" do
      run CPEE::Notifications::Overview if get
      on resource "topics" do
        run CPEE::Notifications::Topics, opts if get
      end
      on resource "subscriptions" do
        run CPEE::Notifications::Subscriptions, id, opts if get
        run CPEE::Notifications::CreateSubscription, id, opts if post 'subscribe'
        on resource do
          run CPEE::Notifications::Subscription, id, opts if get
          run CPEE::Notifications::UpdateSubscription, id, opts if put 'subscribe'
          run CPEE::Notifications::DeleteSubscription, id, opts if delete
          on resource 'sse' do
            run CPEE::Notifications::SSE, id, opts if sse
          end
        end
      end
    end
  end
end