Sha256: ebea4105b5fe61cc5fc5fe30cfd7dd9c4c856e926845d97b6b5aba9ba1a5c7c6

Contents?: true

Size: 764 Bytes

Versions: 5

Compression:

Stored size: 764 Bytes

Contents

module Xdelivery
  class Client

    attr_accessor :merchant_no, :access_key

    def initialize(merchant_no, access_key)
      self.merchant_no = merchant_no
      self.access_key = access_key
    end

    def create_orders!
      api = API::Orders.new(merchant_no, access_key)
      yield(api)
      api.create!
    end

    def create_sales!
      api = API::Sales.new(merchant_no, access_key)
      yield(api)
      api.create!
    end

    def update_products!
      api = API::Products.new(merchant_no, access_key)
      yield(api)
      api.update!
    end

    def get_invoice_settings!
      API::InvoiceSettings.new(merchant_no, access_key).get!
    end

    def ping!
      api = API::Ping.new(merchant_no, access_key)
      api.ping!
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xdelivery-0.2.4 lib/xdelivery/client.rb
xdelivery-0.2.3 lib/xdelivery/client.rb
xdelivery-0.2.2 lib/xdelivery/client.rb
xdelivery-0.2.1 lib/xdelivery/client.rb
xdelivery-0.2.0 lib/xdelivery/client.rb