class RqrcodeKingblade::RqrcodeKingblade

Attributes

filename[RW]

Public Class Methods

new() click to toggle source
# File lib/rqrcode_kingblade.rb, line 8
def initialize
  @kb_colors = KbColors.new
  @kb_colors.title = "test"
  @kb_version = "KBX5"
  @filename = "test.png"
end

Public Instance Methods

add_color(r = 0, g = 0, b = 0, v = 0, a = 0) click to toggle source
# File lib/rqrcode_kingblade.rb, line 19
def add_color(r = 0, g = 0, b = 0, v = 0, a = 0)
  @kb_colors.add_color(r,g,b,v,a)
end
title(title) click to toggle source
# File lib/rqrcode_kingblade.rb, line 15
def title(title)
  @kb_colors.title = title
end
to_img() click to toggle source
# File lib/rqrcode_kingblade.rb, line 29
def to_img
  RQRCode::QRCode.new(@kb_colors.to_s, :size => 14 , :level => 'h').as_img
end
to_qrcode() click to toggle source
# File lib/rqrcode_kingblade.rb, line 23
def to_qrcode
  qr = RQRCode::QRCode.new(@kb_colors.to_s, :size => 14 , :level => 'h')
  png = qr.to_img
  png.resize(360,360).save(@filename)
end
to_svg() click to toggle source
# File lib/rqrcode_kingblade.rb, line 33
def to_svg
  RQRCode::QRCode.new(@kb_colors.to_s, :size => 14 , :level => 'h').as_svg
end