Class: BarcodeCheck
- Inherits:
 - 
      Object
      
        
- Object
 - BarcodeCheck
 
 - Defined in:
 - common/barcode_check.rb
 
Instance Attribute Summary (collapse)
- 
  
    
      - (Object) max 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute max.
 - 
  
    
      - (Object) min 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute min.
 
Instance Method Summary (collapse)
- 
  
    
      - (BarcodeCheck) initialize(repo_code) 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of BarcodeCheck.
 - 
  
    
      - (Boolean) valid?(barcode) 
    
    
  
  
  
  
  
  
  
  
  
    
 
Constructor Details
- (BarcodeCheck) initialize(repo_code)
Returns a new instance of BarcodeCheck
      5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  | 
    
      # File 'common/barcode_check.rb', line 5 def initialize(repo_code) @min = 0 @max = 255 return if !AppConfig.has_key?(:container_management_barcode_length) cfg = AppConfig[:container_management_barcode_length] [:system_default, repo_code].each do |key| if cfg.has_key?(key) @min = cfg[key][:min].to_i if cfg[key].has_key?(:min) @max = cfg[key][:max].to_i if cfg[key].has_key?(:max) end end end  | 
  
Instance Attribute Details
- (Object) max (readonly)
Returns the value of attribute max
      3 4 5  | 
    
      # File 'common/barcode_check.rb', line 3 def max @max end  | 
  
- (Object) min (readonly)
Returns the value of attribute min
      3 4 5  | 
    
      # File 'common/barcode_check.rb', line 3 def min @min end  | 
  
Instance Method Details
- (Boolean) valid?(barcode)
      22 23 24  | 
    
      # File 'common/barcode_check.rb', line 22 def valid?() ! || (min..max).cover?(.length) end  |