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.
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 15 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.
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 35 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 |