Module: Qr4r

Defined in:
lib/qr4r.rb,
lib/qr4r/version.rb

Constant Summary collapse

SIZE_RESTRICTIONS =

These come from rqrcode_core - read github.com/whomwah/rqrcode_core for more information

[0, 7, 14, 24, 34, 44, 58, 64, 84, 98, 119]
VERSION =
"0.6.2".freeze

Class Method Summary collapse

Class Method Details

.encode(str, outfile, *rest) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/qr4r.rb', line 8

def self.encode(str, outfile, *rest)
  opts = rest[0] unless rest.empty?
  opts ||= {}
  opts[:size] = compute_size(str) unless opts[:size]
  opts[:pixel_size] = 3 unless opts[:pixel_size]
  qr_code, data = build_qr_code(str, opts)
  create_image(qr_code, data, outfile, opts)
end