Class: ZATCA::QRCodeGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/zatca/qr_code_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(tags: nil, base64: nil) ⇒ QRCodeGenerator

Returns a new instance of QRCodeGenerator.



5
6
7
8
# File 'lib/zatca/qr_code_generator.rb', line 5

def initialize(tags: nil, base64: nil)
  @tags = tags
  @base64 = base64
end

Instance Method Details

#render(size: 256) ⇒ Object



10
11
12
13
14
# File 'lib/zatca/qr_code_generator.rb', line 10

def render(size: 256)
  qr_code = generate

  qr_code.as_png(size: size, border_modules: 2)&.to_data_url
end