Sha256: 6dbbaaf67ad8bca9b3aa84768397d7e6af62d26653e79d294ff51b3ace2b6dff

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

module JoyUssdEngine
        class DataTransformer   
            # NOTE THIS CLASS SHOULD NEVER BE USED DIRECTLY BUT RATHER BE TREATED AS AN ABSTRACT CLASS
            # THIS CLASS IS USED TO TRANSFORM REQUEST AND RESPONSE OBJECT FROM OUR USSD ENGINE 
            # TO ONE A PROVIDER (Hubtel, Twilio, etc.) CAN UNDERSTAND
            
            # Responsible for transforming ussd requests and responses from different providers into 
            # what our application can understand
            attr_reader :context
            def initialize(context)
                @context = context
            end

            def request_params(params)
                # transform request body of ussd provider currently in use to match the ussd engine request type
            end
            
            def app_terminator(params)
                #Checks to see if ussd app can be terminated by a particular provider depending on the response
                return false
            end

            def response(message, next_menu = nil)
                # Returns a tranformed ussd response for a particular provider and wait for user feedback
            end

            def release(message)
                # Returns a tranformed ussd response for a particular provider and ends the ussd session
            end

            def expiration
                # set expiration for different providers
            end
        end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joy_ussd_engine-0.1.2 lib/joy_ussd_engine/data_transformer.rb
joy_ussd_engine-0.1.0 lib/joy_ussd_engine/data_transformer.rb