Class: WeasyPrint::Configuration
- Inherits:
-
Object
- Object
- WeasyPrint::Configuration
- Defined in:
- lib/weasyprint/configuration.rb
Instance Attribute Summary collapse
-
#default_options ⇒ Object
Returns the value of attribute default_options.
-
#meta_tag_prefix ⇒ Object
Returns the value of attribute meta_tag_prefix.
-
#root_url ⇒ Object
Returns the value of attribute root_url.
-
#verbose ⇒ Object
writeonly
Sets the attribute verbose.
- #weasyprint ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #quiet? ⇒ Boolean
- #verbose? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 |
# File 'lib/weasyprint/configuration.rb', line 6 def initialize @verbose = false @meta_tag_prefix = 'weasyprint-' @default_options = { encoding: 'UTF-8', format: 'pdf' } end |
Instance Attribute Details
#default_options ⇒ Object
Returns the value of attribute default_options.
3 4 5 |
# File 'lib/weasyprint/configuration.rb', line 3 def @default_options end |
#meta_tag_prefix ⇒ Object
Returns the value of attribute meta_tag_prefix.
3 4 5 |
# File 'lib/weasyprint/configuration.rb', line 3 def @meta_tag_prefix end |
#root_url ⇒ Object
Returns the value of attribute root_url.
3 4 5 |
# File 'lib/weasyprint/configuration.rb', line 3 def root_url @root_url end |
#verbose=(value) ⇒ Object (writeonly)
Sets the attribute verbose
4 5 6 |
# File 'lib/weasyprint/configuration.rb', line 4 def verbose=(value) @verbose = value end |
#weasyprint ⇒ Object
15 16 17 |
# File 'lib/weasyprint/configuration.rb', line 15 def weasyprint @weasyprint ||= (defined?(Bundler::GemfileError) ? `bundle exec which weasyprint` : `which weasyprint`).chomp end |
Instance Method Details
#quiet? ⇒ Boolean
19 20 21 |
# File 'lib/weasyprint/configuration.rb', line 19 def quiet? !@verbose end |
#verbose? ⇒ Boolean
23 24 25 |
# File 'lib/weasyprint/configuration.rb', line 23 def verbose? @verbose end |