Class: Elegant::Configuration
- Inherits:
-
Object
- Object
- Elegant::Configuration
- Defined in:
- lib/elegant/configuration.rb
Overview
Provides an object to store global configuration settings.
This class is typically not used directly, but by calling Elegant.configure, which creates and updates a single instance of Configuration.
Instance Attribute Summary collapse
-
#author ⇒ String
The Author to store in the PDF metadata.
-
#creator ⇒ String
The Creator to store in the PDF metadata.
-
#fonts ⇒ Array<Hash<Symbol, Hash<Symbol, String>] the fonts to use.
Array<Hash<Symbol, Hash<Symbol, String>] the fonts to use.
-
#producer ⇒ String
The Producer to store in the PDF metadata.
-
#watermark ⇒ String
The path of an image to display on every page.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
30 31 32 33 34 35 36 |
# File 'lib/elegant/configuration.rb', line 30 def initialize @author = 'Elegant' @creator = 'Elegant' @producer = 'Elegant' @watermark = asset 'images/default_watermark.png' @fonts = {'Sans Serif' => default_font, 'Fallback' => default_font} end |
Instance Attribute Details
#author ⇒ String
Returns the Author to store in the PDF metadata.
16 17 18 |
# File 'lib/elegant/configuration.rb', line 16 def @author end |
#creator ⇒ String
Returns the Creator to store in the PDF metadata.
19 20 21 |
# File 'lib/elegant/configuration.rb', line 19 def creator @creator end |
#fonts ⇒ Array<Hash<Symbol, Hash<Symbol, String>] the fonts to use.
Returns Array<Hash<Symbol, Hash<Symbol, String>] the fonts to use.
28 29 30 |
# File 'lib/elegant/configuration.rb', line 28 def fonts @fonts end |
#producer ⇒ String
Returns the Producer to store in the PDF metadata.
22 23 24 |
# File 'lib/elegant/configuration.rb', line 22 def producer @producer end |
#watermark ⇒ String
Returns the path of an image to display on every page.
25 26 27 |
# File 'lib/elegant/configuration.rb', line 25 def watermark @watermark end |