Sha256: 42e9d4b42941860ad05ae8e1078a7158e21e69b5551bef22ffcdd0ffcf06dca4

Contents?: true

Size: 718 Bytes

Versions: 1

Compression:

Stored size: 718 Bytes

Contents

require 'razorpay/request'


module Razorpay
  class Generic
    def initialize(entity)
      @entity = entity
    end

    def request()
      Razorpay::Request.new(@entity)
    end

    def do(url="", method="Get", options={}, version="v1")
      r = self.request
      r.doesEntityExist(@entity)

      case method
      when "Get"          
        r.get url, options, version

      when "Post"
        r.post url, options, version

      when "Patch"
        r.patch url, options, version
        
      when "Put"
        r.put url, options, version 
      
      when "Delete"
        r.delete url, version
      
      else
        warn("Unsupported method or error occurred") 
      end   
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
razorpay-3.2.0 lib/razorpay/generic.rb