Class: CPEE::Callbacks::GetCallback

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

Overview

}}}

Instance Method Summary collapse

Instance Method Details

#responseObject

{{{



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/cpee/implementation_callbacks.rb', line 34

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

  res = {}
  res[:uuid] = opts[:redis].get("instance:#{id}/callback/#{callback}/uuid")
  res[:type] = opts[:redis].get("instance:#{id}/callback/#{callback}/type")
  res[:position] = opts[:redis].get("instance:#{id}/callback/#{callback}/position")
  res[:label] = opts[:redis].get("instance:#{id}/callback/#{callback}/label")

  Riddl::Parameter::Complex.new("callback","application/json",JSON.generate(res))
end