Sha256: 04080b0126dd2628677b667e93c23d96eb7f674db7542f8f75c1254870709f98

Contents?: true

Size: 732 Bytes

Versions: 16

Compression:

Stored size: 732 Bytes

Contents

#!/usr/bin/env ruby

#--
# Copyright 2004 by Duncan Robertson (duncan@whomwah.com).
# All rights reserved.

# Permission is granted for use, copying, modification, distribution,
# and distribution of modified versions of this work as long as the
# above copyright notice is included.
#++

module RQRCode

  class QR8bitByte
    attr_reader :mode

    def initialize( data )
      @mode = QRMODE[:mode_8bit_byte]
      @data = data;
    end


    def get_length
      @data.size
    end


    def write( buffer )
      ( 0...@data.size ).each do |i|
        c = @data[i]
        c = c.ord if c.respond_to?(:ord)#String#[] returns single-char string in 1.9, .ord gets ASCII pos
        buffer.put( c, 8 )
      end
    end
  end

end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
arena_barby-0.3.2 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-chunky_png-0.3.4 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.4.2 lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.4.1 lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.4.0 lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.3.4 lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.4.3 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.3.3 lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.4.2 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.4.1 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.4.0 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-chunky_png-0.3.3 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.3.2 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.3.1 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
barby-0.3.0 vendor/rqrcode/lib/rqrcode/qrcode/qr_8bit_byte.rb
rqrcode-0.3.2 lib/rqrcode/qrcode/qr_8bit_byte.rb