Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhsu/google-qr
[DEPRECATED]: simple google charts qr code wrapper
https://github.com/jhsu/google-qr
Last synced: about 2 months ago
JSON representation
[DEPRECATED]: simple google charts qr code wrapper
- Host: GitHub
- URL: https://github.com/jhsu/google-qr
- Owner: jhsu
- License: mit
- Created: 2011-01-20T15:38:59.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2014-05-06T23:59:42.000Z (over 10 years ago)
- Last Synced: 2024-10-18T11:31:17.779Z (2 months ago)
- Language: Ruby
- Homepage:
- Size: 218 KB
- Stars: 36
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.mdown
- License: LICENSE
Awesome Lists containing this project
README
# Google Charts QR Code wrapper [![Build Status](http://travis-ci.org/jhsu/google-qr.png)](http://travis-ci.org/jhsu/google-qr)
Generate url strings and HTML img tags for QR codes from [Google's QR code infographics API](https://developers.google.com/chart/infographics/docs/qr_codes)
## Install
gem install google-qr
## Usage
require 'google-qr'
# data and size are both required. size defaults to "100x100".
# The default margin is 4 and default error correction level is 'L'
chart = GoogleQR.new(:data => "SomeDataToQRify", :size => "100x100", :margin => 4, :error_correction => "L")chart.to_s
#=> "https://chart.googleapis.com/chart?cht=qr&chl=SomeDataToQRify&chs=100x100"chart.render
#=> ""
You can also use the to_qr and to_qr_image methods on String objects."ExampleQRData".to_qr
#=> https://chart.googleapis.com/chart?cht=qr&chl=ExampleQRData&chs=100x100"ExampleQRData".to_qr_image
"ExampleQRData".to_qr(:size => "200x200")
#=> https://chart.googleapis.com/chart?cht=qr&chl=ExampleQRData&chs=200x200
## TestingTo run the tests just run the rake command from the root of the gem.