Class: RQRCode::QR8bitByte
- Inherits:
-
Object
- Object
- RQRCode::QR8bitByte
- Defined in:
- lib/rqrcode/qrcode/qr_8bit_byte.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #get_length ⇒ Object
-
#initialize(data) ⇒ QR8bitByte
constructor
A new instance of QR8bitByte.
- #write(buffer) ⇒ Object
Constructor Details
#initialize(data) ⇒ QR8bitByte
Returns a new instance of QR8bitByte.
17 18 19 20 |
# File 'lib/rqrcode/qrcode/qr_8bit_byte.rb', line 17 def initialize( data ) @mode = QRMODE[:mode_8bit_byte] @data = data; end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
15 16 17 |
# File 'lib/rqrcode/qrcode/qr_8bit_byte.rb', line 15 def mode @mode end |
Instance Method Details
#get_length ⇒ Object
23 24 25 |
# File 'lib/rqrcode/qrcode/qr_8bit_byte.rb', line 23 def get_length @data.bytesize end |
#write(buffer) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/rqrcode/qrcode/qr_8bit_byte.rb', line 28 def write( buffer) buffer.byte_encoding_start(get_length) @data.each_byte do |b| buffer.put(b, 8) end end |