Class: QrForge::Exporter
- Inherits:
-
Object
- Object
- QrForge::Exporter
- Defined in:
- lib/qr_forge/exporter.rb
Overview
Handles exporting the generated QR code in various formats.
Instance Method Summary collapse
-
#export(svg) ⇒ String
Exports the generated QR code in the specified format.
-
#initialize(config:) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(config:) ⇒ Exporter
Returns a new instance of Exporter.
7 8 9 |
# File 'lib/qr_forge/exporter.rb', line 7 def initialize(config:) @format = config.dig(:output, :format) || :svg end |
Instance Method Details
#export(svg) ⇒ String
Exports the generated QR code in the specified format.
16 17 18 19 20 21 22 23 |
# File 'lib/qr_forge/exporter.rb', line 16 def export(svg) case @format when :svg process_svg(svg) else raise "Unsupported export format: #{@format}" end end |