Conversation
lib/xpm_ruby/staff/sax_parser.rb
Outdated
| end | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Won't claim to be an expert at writing SAX parsers 😅
There was a problem hiding this comment.
have kept the puts in there as they're pretty useful for debugging.
| end | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Integration with VCR soon
| end | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Could keep it as a PORO or use something like dry types? Open to ideas.
We can also delay a decision too - shouldn't break any tests.
There was a problem hiding this comment.
I am happy keeping it as a PORO for now...
lib/xpm_ruby/staff.rb
Outdated
| def list(api_key:, account_key:) | ||
| key = Base64.strict_encode64("#{api_key}:#{account_key}") | ||
|
|
||
| http_response = Faraday |
There was a problem hiding this comment.
Hi @subskii it looks like there is functionality in here that should be in the connector? Is this code intended to be temporary?
There was a problem hiding this comment.
Yeap this is just to get the ball rolling 😉.
Let's swap it out with your code in a follow up PR 👍
xpm_ruby.gemspec
Outdated
| spec.require_paths = ["lib"] | ||
|
|
||
| spec.add_runtime_dependency("faraday", "~> 1") | ||
| spec.add_runtime_dependency("ox", "~> 2.13") |
There was a problem hiding this comment.
Any particular reason to use ox over nokogiri? :)
There was a problem hiding this comment.
Came across a somewhat older article praising it's memory usage. Seems a lot lighter and well optimised based on reviews.
Check out the description.
There was a problem hiding this comment.
Ah ok cool. I will check it out.
:)
This reverts commit 05de0bc.
| .get(endpoint: "staff.api/list") | ||
|
|
||
| case response.status | ||
| when 401 |
There was a problem hiding this comment.
For later (not this PR), maybe we should create an ConnectionErrors module (might help us DRY up the code a bit)? What do you think @subskii ?
There was a problem hiding this comment.
I guess let's see how this develops. :)
* add Staff.list * fix model namespace * remove extra line * drop sax parser * remove parser spec * optimise * fix payroll_code * add dry typesa * Revert "add dry typesa" This reverts commit 05de0bc. * superclass errors + add api_url * update to use Connection
Intention (What)
Motivation (Why)
WorkflowMAX and Xero Practice Manager API v3 are out and we need to upgrade soon.
Implementation (How)
Connectionto get http responseOxto convert xml body string to hashPORO's with kwargs to define model structure