Class: OpenPayResourceFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/openpay/open_pay_resource_factory.rb

Class Method Summary collapse

Class Method Details

.create(resource, merchant_id, private_key, production, timeout) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/openpay/open_pay_resource_factory.rb', line 2

def OpenPayResourceFactory::create(resource,merchant_id,private_key,production,timeout)
  begin
    Object.const_get(resource.capitalize).new(merchant_id,private_key,production,timeout)
  rescue NameError
    raise OpenpayException.new("Invalid resource name:#{resource}",false)
  end
end