Class: RubyHlrClient::HlrCallbackHandler
- Inherits:
-
Object
- Object
- RubyHlrClient::HlrCallbackHandler
- Defined in:
- lib/ruby_hlr_client/hlr_callback_handler.rb
Instance Method Summary collapse
- #generate_error_result(message) ⇒ Object
-
#parse_callback(params) ⇒ Object
Parses an asynchronous HLR Lookup callback and returns a JSON string with the results.
- #send_response ⇒ Object
Instance Method Details
#generate_error_result(message) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/ruby_hlr_client/hlr_callback_handler.rb', line 27 def generate_error_result() result = {:success => false, :fieldErrors => [], :globalErrors => ["#{}"]} result.to_json end |
#parse_callback(params) ⇒ Object
Parses an asynchronous HLR Lookup callback and returns a JSON string with the results. Return example: 05:53:03.765798+08”,“storage”:“ASYNC-API”,“route”:“IP4”]}
11 12 13 14 15 16 17 18 19 |
# File 'lib/ruby_hlr_client/hlr_callback_handler.rb', line 11 def parse_callback(params) unless params.has_key?('json') return generate_error_result('Invalid callback parameters. Missing json payload.') end params['json'] end |
#send_response ⇒ Object
21 22 23 24 25 |
# File 'lib/ruby_hlr_client/hlr_callback_handler.rb', line 21 def send_response 'OK' end |