class RQRCode::QR8bitByte

Attributes

mode[R]

Public Class Methods

new( data ) click to toggle source
# File lib/rqrcode/qrcode/qr_8bit_byte.rb, line 17
def initialize( data )
  @mode = QRMODE[:mode_8bit_byte]
  @data = data;
end

Public Instance Methods

get_length() click to toggle source
# File lib/rqrcode/qrcode/qr_8bit_byte.rb, line 23
def get_length
  @data.size
end
write( buffer ) click to toggle source
# File lib/rqrcode/qrcode/qr_8bit_byte.rb, line 28
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