module Airtel::Pesa

Constants

VERSION

Public Class Methods

configuration() click to toggle source
# File lib/airtel/pesa.rb, line 12
def self.configuration
  @configuration ||= OpenStruct.new(
    client_id: nil,
    client_secret: nil,
    pass_key: nil,
    short_code: nil,
    response_type: nil,
    callback_url: nil,
    result_url: nil,
    queue_time_out_url: nil,
    default_description: nil,
    enviroment: nil
  )
end
configure() { |configuration| ... } click to toggle source
# File lib/airtel/pesa.rb, line 27
def self.configure
  yield(configuration)
end

Public Instance Methods

to_recursive_ostruct(hash) click to toggle source
# File lib/airtel/pesa.rb, line 31
def to_recursive_ostruct(hash)
  result = hash.each_with_object({}) do |(key, val), memo|
      memo[key] = val.is_a?(Hash) ? to_recursive_ostruct(val) : val
  end

  OpenStruct.new(result)
end