Class: CPEE::Callbacks::DelCallback

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'lib/cpee/implementation_callbacks.rb', line 76

def response
  id = @a[0]
  opts = @a[1]
  callback = @r[-1]

  if CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'callback'
    CPEE::Message::send(
      :'callback-end',
      callback,
      opts[:url],
      id,
      {},
      {},
      {},
      opts[:redis]
    )
  elsif CPEE::Persistence::extract_item(id,opts,"callback/#{callback}/type") == 'vote'
    CPEE::Message::send(
      :'vote-response',
      callback,
      opts[:url],
      id,
      {},
      {},
      'true',
      opts[:redis]
    )
  else
    @status = 404
  end
  nil
end