Class: ShopifyDump::Dumper
- Inherits:
-
Object
- Object
- ShopifyDump::Dumper
- Defined in:
- lib/shopify_dump/dumper.rb
Constant Summary collapse
- API_KEY =
ENV["API_KEY"]
- PASSWORD =
ENV["PASSWORD"]
- SHOP_NAME =
ENV["SHOP_NAME"]
- API_VERSION =
ENV["API_VERSION"]
Instance Method Summary collapse
- #dump(query, file_suffix = "") ⇒ Object
-
#initialize ⇒ Dumper
constructor
A new instance of Dumper.
Constructor Details
#initialize ⇒ Dumper
Returns a new instance of Dumper.
13 14 15 16 17 18 |
# File 'lib/shopify_dump/dumper.rb', line 13 def initialize ShopifyAPI::Base.site = "https://#{API_KEY}:#{PASSWORD}@#{SHOP_NAME}.myshopify.com" ShopifyAPI::Base.api_version = API_VERSION @client = ShopifyAPI::GraphQL.client @logger = Logger.new(STDOUT) end |
Instance Method Details
#dump(query, file_suffix = "") ⇒ Object
20 21 22 23 24 25 |
# File 'lib/shopify_dump/dumper.rb', line 20 def dump(query, file_suffix = "") # start bulk operation start_bulk_operation(query) # download jsonl file download_jsonl(fetch_download_url, file_suffix) end |