Module: Sevgi::Graphics::Mixtures::Export
- Defined in:
- lib/sevgi/graphics/mixtures/export.rb
Overview
DSL helpers for native SVG export formats.
Instance Method Summary collapse
-
#PDF(path = nil, **kwargs, &block) ⇒ String
Exports the document as PDF.
-
#PNG(path = nil, **kwargs, &block) ⇒ String
Exports the document as PNG.
Instance Method Details
#PDF(path = nil, **kwargs, &block) ⇒ String
Exports the document as PDF.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 14 def PDF(path = nil, **kwargs, &block) begin require "sevgi/sundries" rescue ::LoadError => e raise unless e.path == "sevgi/sundries" MissingComponentError.("sevgi/sundries") end Export(path, **kwargs, format: :pdf, &block) end |
#PNG(path = nil, **kwargs, &block) ⇒ String
Exports the document as PNG.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 33 def PNG(path = nil, **kwargs, &block) begin require "sevgi/sundries" rescue ::LoadError => e raise unless e.path == "sevgi/sundries" MissingComponentError.("sevgi/sundries") end Export(path, **kwargs, format: :png, &block) end |