lib/weixin_authorize/handler/result_handler.rb
def package_result(result)
        return result if !result.is_a?(Hash)
        if defined?(Rails)
          ActiveSupport::HashWithIndifferentAccess.new(result)
        else
          result
        end
      end
def package_result(result)
        return result if !result.is_a?(Hash)
        if defined?(Rails)
          ActiveSupport::HashWithIndifferentAccess.new(result)
        else
          result
        end
      end
def package_result ( result ) return result if ! result . is_a? ( Hash ) if defined? ( Rails ) ActiveSupport :: HashWithIndifferentAccess . new ( result ) else result end end
if define Rails constant
 result = WeixinAuthorize::ResultHandler.new("0", "success", {:ok => "true"})
 result.result["ok"] #=> true
 result.result[:ok] #=> true
 result.result['ok'] #=> true
if define Rails constant result = WeixinAuthorize :: ResultHandler . new ( 0 success { : ok = > true } ) result . result [ ok ] # = > true result . result [ : ok ] # = > true result . result [ ok ] # = > true