Class: RQRCodeCore::QR8bitByte
- Inherits:
-
Object
- Object
- RQRCodeCore::QR8bitByte
- Defined in:
- lib/rqrcode_core/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.
7 8 9 10 |
# File 'lib/rqrcode_core/qrcode/qr_8bit_byte.rb', line 7 def initialize( data ) @mode = QRMODE[:mode_8bit_byte] @data = data; end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
5 6 7 |
# File 'lib/rqrcode_core/qrcode/qr_8bit_byte.rb', line 5 def mode @mode end |
Instance Method Details
#get_length ⇒ Object
13 14 15 |
# File 'lib/rqrcode_core/qrcode/qr_8bit_byte.rb', line 13 def get_length @data.bytesize end |
#write(buffer) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/rqrcode_core/qrcode/qr_8bit_byte.rb', line 18 def write( buffer) buffer.byte_encoding_start(get_length) @data.each_byte do |b| buffer.put(b, 8) end end |