lib/sapos/print/configuration.rb in sapos-print-1.1.2 vs lib/sapos/print/configuration.rb in sapos-print-1.1.3

- 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, :duplicate_control, :cache, :printers + attr_accessor :printer, :adapter, :interface, :q, :key, :emv_path, :emv_terminal, :user_id, :verbose, :duplicate_control, :cache, :printers, :interfaces def self.write(args = {}) config_file = "#{Sapos::Print.app_directory}/config.yml" File.write(config_file, args.to_yaml) end @@ -18,10 +18,11 @@ if File.exist?(config_file) template = ERB.new(File.read(config_file)) result = YAML.load(template.result(binding)) @printer = result[:printer] @printers = result[:printers] || [] + @interfaces = result[:interfaces] || [] @adapter = result[:adapter] @interface = result[:interface] @q = result[:q] @key = result[:key] @emv_path = result[:emv_path] @@ -50,10 +51,10 @@ 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, duplicate_control: @duplicate_control, printers: @printers } + {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, printers: @printers, interfaces: @interfaces } end end end end \ No newline at end of file