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) {|svg| ... } ⇒ String
Exports the document as PDF.
-
#PNG(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PNG.
Instance Method Details
#PDF(path = nil, **kwargs) {|svg| ... } ⇒ String
Exports the document as PDF.
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 18 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) {|svg| ... } ⇒ String
Exports the document as PNG.
41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/sevgi/graphics/mixtures/export.rb', line 41 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 |