Created
October 27, 2022 19:46
-
-
Save JaredShay/22a9fb8d64fbe1d24eb693d7aa17117d to your computer and use it in GitHub Desktop.
Psuedo Code for abstraction levels in w9 parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Airtable | |
API_CREDENTIALS = '123' | |
self.fetch | |
responses = call_the_airtable_api(API_CREDENTIALS) | |
responses.map { |r| Record.new(r) } | |
new(responses) | |
end | |
def initialize(responses) | |
@response = responses | |
end | |
def call_the_airtable_api(credentials) | |
# calls some airtable api | |
end | |
class Record | |
def initialize(air_table_raw_response) | |
@air_table_raw_response | |
end | |
def url | |
@air_table_raw_response['fields']['W9 - W8BEN'][0]['url'] | |
end | |
end | |
end | |
# import stuff | |
import Airtable | |
airtable = AirTable.fetch | |
# response is a Record class | |
for response in airtable.responses | |
next if response.ocr_scan_complete? | |
url = response.url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment