Skip to content

Instantly share code, notes, and snippets.

@JaredShay
Created October 27, 2022 19:46
Show Gist options
  • Save JaredShay/22a9fb8d64fbe1d24eb693d7aa17117d to your computer and use it in GitHub Desktop.
Save JaredShay/22a9fb8d64fbe1d24eb693d7aa17117d to your computer and use it in GitHub Desktop.
Psuedo Code for abstraction levels in w9 parser
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