lib/sapos/print/configuration.rb in sapos-print-1.0.9 vs lib/sapos/print/configuration.rb in sapos-print-1.0.10

- old
+ new

@@ -4,11 +4,11 @@ module Sapos module Print class Configuration - attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose + attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose, :duplicate_control, :cache def self.write(args = {}) config_file = "#{Sapos::Print.app_directory}/config.yml" File.write(config_file, args.to_yaml) end @@ -24,10 +24,12 @@ @q = result[:q] @key = result[:key] @emv_path = result[:emv_path] @emv_terminal = result[:emv_terminal] @user_id = result[:user_id] + @duplicate_control = result[:duplicate_control] + @cache = [] else raise Sapos::Print::Error, "Configuration is missing. Make sure to create this file: #{config_file}" end end @@ -40,12 +42,16 @@ end def verify? @verify == true end + + def duplicate_control? + @duplicate_control.to_s.downcase.eql?("si") + end def to_h - {printer: @printer, adapter: @adapter, interface: @interface, q: @q, key: @key, emv_path: @emv_path, emv_terminal: @emv_terminal, user_id: @user_id } + {printer: @printer, adapter: @adapter, interface: @interface, q: @q, key: @key, emv_path: @emv_path, emv_terminal: @emv_terminal, user_id: @user_id, duplicate_control: @duplicate_control } end end end end \ No newline at end of file