Sha256: 508634620bed00fbf086ada066941154c13416a644c2849b2c86b310e13df44a

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

#   Lightspeed Restaurant Ruby Bindings
#   API spec at http://staging-exact-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/receipt'

module LightspeedRestaurant
  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

2 entries across 2 versions & 1 rubygems

Version Path
lightspeed_restaurant-0.2.0 lib/lightspeed_restaurant.rb
lightspeed_restaurant-0.1.5 lib/lightspeed_restaurant.rb