Class: PhantomPDF::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/phantompdf/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Config

Returns a new instance of Config.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/phantompdf/config.rb', line 6

def initialize(options={})
  @default_options = {
    :format            => 'A4',
    :header            => nil,
    :footer            => nil,
    :margin            => '1cm',
    :orientation       => 'portrait',
    :zoom              => 1,
    :cookies           => {},
    :timeout           => 90000,
    :rendering_timeout => 1000
  }

  @default_options.merge! options || {}
end

Instance Attribute Details

#default_optionsObject

Returns the value of attribute default_options.



3
4
5
# File 'lib/phantompdf/config.rb', line 3

def default_options
  @default_options
end

#phantomjsObject (readonly)

Returns the value of attribute phantomjs.



4
5
6
# File 'lib/phantompdf/config.rb', line 4

def phantomjs
  @phantomjs
end