Sha256: 784b6014e7aafc0c2557f07e676e6f651fc4cb676d3581614e8640d9d41b6bb6
Contents?: true
Size: 1.15 KB
Versions: 5
Compression:
Stored size: 1.15 KB
Contents
# Arctic vendor This gem is the backbone used for communication from Vendors to the Core API. ## Usage Install the gem: ```ruby gem 'arctic-vendor' ``` Then in your code: ```ruby require 'bundler/setup' require 'arctic/vendor' module Arctic module Vendor module Dandomain # <-- Change this depending on the vendor you're using def collect_products Arctic::Vendor.collect_products do |shop| # Retrieve products from the shop and return them to the block end end module_function :collect_products def distribute_products Arctic::Vendor.distribute_products do |shop, products| # Send the products to the shop and return the products to the block end end module_function :distribute_products end end end ``` Then in your Rakefile: ```ruby require_relative "./path/to/your/lib" desc "Sync" task :sync do # You can skip either of these if the vendor doesn't support either pulling or # pushing products and orders. Arctic::Vendor::Dandomain.collect_products Arctic::Vendor::Dandomain.distribute_products end ``` ## Testing Run all the tests: ```bash rake test ```
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
arctic-vendor-1.0.1 | README.md |
arctic-vendor-1.0.0 | README.md |
arctic-vendor-0.2.4 | README.md |
arctic-vendor-0.2.3 | README.md |
arctic-vendor-0.2.2 | README.md |