You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the promisepay API resources are standard REST, almost all the classes *Resource do pretty much the same. There is no need of that such amount of code repetition that degrade the code quality and increase complexity.
What i'm talking is doing something like:
modulePromisepayclassRestResource < BaseResourcedeffind_all(options={})response=JSON.parse(@client.get(resource_key_name,options).body)resources=response.key?(resource_key_name) ? response[resource_key_name] : []resources.map{ |attributes| model.new(@client,attributes)}end# So on for all the others rest actions.endendmodulePromisepay# Resource for the Users APIclassUserResource < RestResourcedefmodelPromisepay::Userenddefresource_key_name"users"end# any extra method needed.endend
The text was updated successfully, but these errors were encountered:
As the promisepay API resources are standard REST, almost all the classes *Resource do pretty much the same. There is no need of that such amount of code repetition that degrade the code quality and increase complexity.
What i'm talking is doing something like:
The text was updated successfully, but these errors were encountered: