Class: RQREncoder::QRCode
- Inherits:
-
Object
- Object
- RQREncoder::QRCode
- Defined in:
- lib/rqrencoder-magick/qrcode_ext.rb
Constant Summary collapse
- @@default_render_options =
{:module_pixels => 10, :margin => 4, :fill_color => 'black', :background_color => 'white'}
Instance Method Summary collapse
- #draw(render_options = {}) ⇒ Object
-
#draw_svg(render_options = {}) ⇒ Object
imagemagick’s svg output is messed up.
- #save(filename, render_options = {}) ⇒ Object
- #save_svg(filename, render_options = {}) ⇒ Object
Instance Method Details
#draw(render_options = {}) ⇒ Object
11 12 13 |
# File 'lib/rqrencoder-magick/qrcode_ext.rb', line 11 def draw( = {}) render_rvg(@@default_render_options.merge()).draw end |
#draw_svg(render_options = {}) ⇒ Object
imagemagick’s svg output is messed up
20 21 22 |
# File 'lib/rqrencoder-magick/qrcode_ext.rb', line 20 def draw_svg( = {}) render_svg(@@default_render_options.merge()) end |
#save(filename, render_options = {}) ⇒ Object
15 16 17 |
# File 'lib/rqrencoder-magick/qrcode_ext.rb', line 15 def save(filename, = {}) draw().write(filename) end |
#save_svg(filename, render_options = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/rqrencoder-magick/qrcode_ext.rb', line 24 def save_svg(filename, = {}) file = File.new(filename, "w") file.puts(draw_svg()) file.close end |