Class: WeasyPrint::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/weasyprint/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_optionsObject

Returns the value of attribute default_options.



3
4
5
# File 'lib/weasyprint/configuration.rb', line 3

def default_options
  @default_options
end

#meta_tag_prefixObject

Returns the value of attribute meta_tag_prefix.



3
4
5
# File 'lib/weasyprint/configuration.rb', line 3

def meta_tag_prefix
  @meta_tag_prefix
end

#root_urlObject

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

Parameters:

  • value

    the value to set the attribute verbose to.



4
5
6
# File 'lib/weasyprint/configuration.rb', line 4

def verbose=(value)
  @verbose = value
end

#weasyprintObject



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

Returns:

  • (Boolean)


19
20
21
# File 'lib/weasyprint/configuration.rb', line 19

def quiet?
  !@verbose
end

#verbose?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/weasyprint/configuration.rb', line 23

def verbose?
  @verbose
end