lib/barby/barcode/code_128.rb
#Handle a Code A segment which may contain Code B parts, but may not
#contain any Code C parts.
Handle a Code A segment which may contain Code B parts, but may not
contain any Code C parts.
Handle a Code A segment which may contain Code B parts but may not contain any Code C parts .
def handle_code_a(data)
        indata = data.dup
        outdata = CODEA.dup 
        while char = indata.slice!(0)
          if lowercase_character?(char) 
            if control_before_lowercase?(indata)
              outdata << SHIFT << char 
            else
              outdata << handle_code_b(char+indata) 
              break
            end
          else
            outdata << char
          end
        end
        outdata
      end
def handle_code_a ( data ) indata = data . dup outdata = CODEA . dup while char = indata . slice! ( 0 ) if lowercase_character? ( char ) if control_before_lowercase? ( indata ) outdata << SHIFT << char else outdata << handle_code_b ( char + indata ) break end else outdata << char end end outdata end
Handle a Code A segment which may contain Code B parts, but may not
contain any Code C parts.
Handle a Code A segment which may contain Code B parts but may not contain any Code C parts .
#We know it'll be A #Found a lower case character (Code B) #Control character appears before a new lowercase, use shift #Switch to Code B #while
data