Module: Bianchi::USSD::ProviderConfigurations
- Includes:
- Bianchi::USSD::ProviderParsers::Africastalking, Bianchi::USSD::ProviderParsers::Appsnmobile
- Included in:
- Engine
- Defined in:
- lib/bianchi/ussd/provider_configurations.rb
Instance Method Summary collapse
Methods included from Bianchi::USSD::ProviderParsers::Appsnmobile
#appsnmobile_params_parser, #appsnmobile_prompt_data_parser, #return_activity_state
Methods included from Bianchi::USSD::ProviderParsers::Africastalking
#africastalking_params_parser, #africastalking_prompt_data_parser
Instance Method Details
#parse_params(params) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bianchi/ussd/provider_configurations.rb', line 9 def parse_params(params) provider_parsers = { none: proc { params }, africastalking: proc { africastalking_params_parser(params) }, appsnmobile: proc { appsnmobile_params_parser(params) } }.with_indifferent_access parser = provider_parsers[@provider] raise ProviderError, "Could not find configurations for provider(#{@provider}) specified" unless parser.present? parser.call end |
#parser_prompt_data(prompt_data) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/bianchi/ussd/provider_configurations.rb', line 23 def parser_prompt_data(prompt_data) provider_parsers = { none: proc { prompt_data }, africastalking: proc { africastalking_prompt_data_parser(prompt_data) }, appsnmobile: proc { appsnmobile_prompt_data_parser(prompt_data) } }.with_indifferent_access parser = provider_parsers[@provider] raise StandardError, "could not parse response data for the provider specified." unless parser.present? parser.call end |