Use keyword-args#20
Conversation
Note: This is a breaking change
Function definition takes in (object_type: , parameters: ) as input.
Previous create calls were as following
request.create(:CUSTOMER, {
CUSTOMERID: '1',
FIRST_NAME: 'Han',
LAST_NAME: 'Solo',
TYPE: 'Person',
EMAIL1: 'han@solo.com',
STATUS: 'active'
})
From now on, the requests pass arguments explicitly as following
request.create(object_type: :CUSTOMER, parameters: {
CUSTOMERID: '1',
FIRST_NAME: 'Han',
LAST_NAME: 'Solo',
TYPE: 'Person',
EMAIL1: 'han@solo.com',
STATUS: 'active'
})
As the read requests don't need an object_type, a read request would look like following
request.readMore(object_type: nil, parameters: {resultId: result_id})
The default value for object_type is nil so read requests can also be called like following
request.readMore(parameters: {resultId: result_id})
|
@danielpowell4 , please have a look at this PR. Don't know if any changes are needed for the specific functions like |
|
@bezoar17 Thanks for this! My first impression is that this is good to go. I am going to need a bit of time to dive in and make sure I'm 1000% confident in terms of how it looks and interacts with the rest of the gem. Will report back when possible |
|
Cool, no hurries. This will be a breaking and possibly big change. |
|
@bezoar17 Spoke to @jzornow and confirmed that this looking 👍 Much of the seeming "create" code supported Intacct's DTD 2.1 syntax and is actually dead now I want to run a few tests and do some cleanup later on this week but think it will likely be good to go as is. As this will result in a fairly sizeable change to the API, might be smart to bump the version to 2.0 when the release is ready Thanks again for this! |
Contributor Self-Check:
Which GitHub Issues does this PR address?
None
What does this PR do?
Clean up the gem's API to use keyword arguments for read requests.
How do I manually test this?
The test cases have been updated acc to the changes.
GIF for how this PR makes me feel