Class | RQRCode::QRBitBuffer |
In: |
lib/rqrcode/qrcode/qr_bit_buffer.rb
|
Parent: | Object |
buffer | [R] |
# File lib/rqrcode/qrcode/qr_bit_buffer.rb, line 17 17: def initialize 18: @buffer = [] 19: @length = 0 20: end
# File lib/rqrcode/qrcode/qr_bit_buffer.rb, line 23 23: def get( index ) 24: buf_index = (index / 8).floor 25: (( (@buffer[buf_index]).rszf(7 - index % 8)) & 1) == 1 26: end
# File lib/rqrcode/qrcode/qr_bit_buffer.rb, line 29 29: def put( num, length ) 30: ( 0...length ).each do |i| 31: put_bit((((num).rszf(length - i - 1)) & 1) == 1) 32: end 33: end