Skip to content
master
Go to file
Code
This branch is 4 commits ahead, 3 commits behind sadasant:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.mkd

mruby-qrcode

A simple mrbgem to generate QR Codes.

Example

Initialize the object with contents you want in the QR code qr = QR.new("Hello world!"), later you'll be able to change these contents by changing the value of qr.msg. To generate the bytecodes of the QR code, simply call qr.generate()("bmp" as default format and 3 as default magnify), it will return a string buffer which you can use to write the QR code file.

qr  = QR.new("Hello world!")
buf = qr.generate("bmp", 3)
File.open("qrcode_hello_world.bmp", 'w') { |file| file.write(buf) }

The example above will generate the following QR code:

NOTE: By default, the filetype is BMP, you can change this by sending the file format to the generate method, the available formats are: PNG, BMP, TIFF, PBM, SVG, JSON, DIGIT and ASCII.

TEST

Run the tests with:

./run_test.rb test

LICENSE

Check the LICENSE file.

About

A simple mrbgem to generate QR Codes.

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.