lib/voucherify/client.rb in voucherify-1.3.0 vs lib/voucherify/client.rb in voucherify-1.4.0

- old
+ new

@@ -12,12 +12,13 @@ @backend_url = 'https://api.voucherify.io/v1' @headers = { 'X-App-Id' => @options[:applicationId] || @options['applicationId'], 'X-App-Token' => @options[:clientSecretKey] || @options['clientSecretKey'], 'X-Voucherify-Channel' => 'Ruby-SDK', - :accept => :json - } + 'X-Voucherify-API-Version' => @options[:apiVersion] || @options['apiVersion'], + :accept => :json, + }.reject{ |k,v| v.nil? } end def vouchers Voucherify::Service::Vouchers.new(self) end @@ -42,9 +43,17 @@ Voucherify::Service::Products.new(self) end def campaigns Voucherify::Service::Campaigns.new(self) + end + + def validation_rules + Voucherify::Service::ValidationRules.new(self) + end + + def segments + Voucherify::Service::Segments.new(self) end def get(path, params = {}) begin url = @backend_url + path \ No newline at end of file