Module: Bianchi::USSD::ProviderConfigurations
- Includes:
- Bianchi::USSD::ProviderParsers::Africastalking, Bianchi::USSD::ProviderParsers::Appsnmobile, Bianchi::USSD::ProviderParsers::Arkesel
- Included in:
- Engine
- Defined in:
- lib/bianchi/ussd/provider_configurations.rb
Instance Method Summary collapse
Methods included from Bianchi::USSD::ProviderParsers::Arkesel
#arkesel_params_parser, #arkesel_prompt_data_parser
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
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/bianchi/ussd/provider_configurations.rb', line 10 def parse_params(params) provider_parsers = { none: proc { params }, africastalking: proc { africastalking_params_parser(params) }, appsnmobile: proc { appsnmobile_params_parser(params) }, arkesel: proc { arkesel_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
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/bianchi/ussd/provider_configurations.rb', line 25 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) }, arkesel: proc { arkesel_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 |