class Wamp::Client::Request::Register
Public Instance Methods
create_request(request_id, procedure, handler, options=nil, interrupt=nil, &callback)
click to toggle source
# File lib/wamp/client/request/register.rb, line 17 def create_request(request_id, procedure, handler, options=nil, interrupt=nil, &callback) # Create the lookup lookup = {p: procedure, h: handler, i: interrupt, o: options, c: callback} # Create the message message = Message::Register.new(request_id, options, procedure) # Return [lookup, message] end
process_error(message, lookup)
click to toggle source
# File lib/wamp/client/request/register.rb, line 57 def process_error(message, lookup) if lookup # Get the params procedure = lookup[:p] callback = lookup[:c] # Create the details details = message.details || {} details[:procedure] = procedure unless details[:procedure] details[:type] = 'register' # Return the values [callback, details] else [nil, nil] end end
process_success(message, lookup)
click to toggle source
# File lib/wamp/client/request/register.rb, line 29 def process_success(message, lookup) if lookup # Get the params procedure = lookup[:p] handler = lookup[:h] options = lookup[:o] interrupt = lookup[:i] callback = lookup[:c] # Create the subscription r_id = message.registration r = Manager::RegistrationObject.new(procedure, handler, options, interrupt, self.session, r_id) # Create the details details = {} details[:procedure] = procedure details[:type] = 'register' # Call the on_success method self.on_success.call(r_id, r) # Return the values [callback, r, details] else [nil, nil, nil] end end