lib/lightspeed_restaurant.rb in lightspeed_restaurant-0.1.3 vs lib/lightspeed_restaurant.rb in lightspeed_restaurant-0.1.4

- old
+ new

@@ -4,34 +4,35 @@ 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_url - end + attr_accessor :api_token, :base_uri - def self.get(path, body = {}, query = {}) - request(path, body, query).perform(method: :get) - end + def get(path, body = {}, query = {}) + request(path, body, query).perform(method: :get) + end - def self.post(path, body = {}, query = {}) - request(path, body, query).perform(method: :post) - end + def post(path, body = {}, query = {}) + request(path, body, query).perform(method: :post) + end - def self.put(path, body = {}, query = {}) - request(path, body, query).perform(method: :put) - end + def put(path, body = {}, query = {}) + request(path, body, query).perform(method: :put) + end - def self.delete(path, body = {}, query = {}) - request(path, body, query).perform(method: :delete) - end + def delete(path, body = {}, query = {}) + request(path, body, query).perform(method: :delete) + end - private - - def self.request(path, body, query) - LightspeedRestaurant::Request.new(@base_url, path, @api_token, body, query) + def request(path, body, query) + Request.new(@base_uri, path, @api_token, body, query) + end end end