Sha256: 2b6aeee1b28bb7ee776b33a8760c49a75cbbba59dfbcfc21d0b5b3d10030caf0

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

#   Lightspeed Restaurant Ruby Bindings
#   API spec at http://stating-integration.posios.com/PosServer/swagger-ui.html

require 'excon'
require 'json'

require 'lightspeed_restaurant/version'
require 'lightspeed_restaurant/request'

require 'lightspeed_restaurant/customer'
require 'lightspeed_restaurant/customer_credit_change'
require 'lightspeed_restaurant/customer_loyalty_card'
require 'lightspeed_restaurant/receipt'
require 'lightspeed_restaurant/company'

module LightspeedRestaurantClient
  class << self
    attr_accessor :api_token, :base_uri

    def get(path, body = {}, query = {})
      request(path, body, query).perform(method: :get)
    end

    def post(path, body = {}, query = {})
      request(path, body, query).perform(method: :post)
    end

    def put(path, body = {}, query = {})
      request(path, body, query).perform(method: :put)
    end

    def delete(path, body = {}, query = {})
      request(path, body, query).perform(method: :delete)
    end

    private

    def request(path, body, query)
      Request.new(@base_uri, path, @api_token, body, query)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lightspeed_restaurant-1.1.2 lib/lightspeed_restaurant.rb
lightspeed_restaurant-1.1.1 lib/lightspeed_restaurant.rb
lightspeed_restaurant-1.1.0 lib/lightspeed_restaurant.rb