class Promisepay::BaseResource
Base resource for all the other resources to inherit from
Public Class Methods
new(client)
click to toggle source
# File lib/promisepay/resources/base_resource.rb, line 4 def initialize(client) @client = client end
Public Instance Methods
method_missing(name, *args, &block)
click to toggle source
Calls superclass method
# File lib/promisepay/resources/base_resource.rb, line 8 def method_missing(name, *args, &block) if instance_methods.include?(model) && respond_to?(name) model.new(@client, id: args[0]).send(name, *args[1..-1]) else super end end
respond_to?(name, include_all = false)
click to toggle source
Calls superclass method
# File lib/promisepay/resources/base_resource.rb, line 16 def respond_to?(name, include_all = false) super || model.new(@client).respond_to?(name, include_all) end