Sha256: 8a0ed10efc83ecfd2e9788e7bef5171245c4c7e542f94dd26d1c5012cf0ea4f9

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 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 update_products!
      api = API::Products.new(merchant_no, access_key)
      yield(api)
      api.update!
    end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xdelivery-0.1.4 lib/xdelivery/client.rb
xdelivery-0.1.3 lib/xdelivery/client.rb
xdelivery-0.1.2 lib/xdelivery/client.rb
xdelivery-0.1.1 lib/xdelivery/client.rb