Sha256: 866a9c46c8572670cf2d33e16875feb51518696500f2ba786a7d01cddeda1d14

Contents?: true

Size: 743 Bytes

Versions: 6

Compression:

Stored size: 743 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_shops!
      API::Shops.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

6 entries across 6 versions & 1 rubygems

Version Path
xdelivery-2.0.3 lib/xdelivery/client.rb
xdelivery-2.0.1 lib/xdelivery/client.rb
xdelivery-2.0.0 lib/xdelivery/client.rb
xdelivery-1.0.2 lib/xdelivery/client.rb
xdelivery-1.0.1 lib/xdelivery/client.rb
xdelivery-1.0.0 lib/xdelivery/client.rb