Class: WkHtml::ToImage::GlobalSettings

Inherits:
Object
  • Object
show all
Includes:
Settings
Defined in:
lib/wkhtml/to_image/global_settings.rb,
ext/wkhtml/wkhtml.c

Constant Summary collapse

KEYS =
%w(
  crop.left
  crop.top
  crop.width
  crop.height
  load.cookieJar
  transparent
  in
  out
  fmt
  screenWidth
  smartWidth
  quality
)
DEFAULTS =
{
  'fmt' => CommonSettings::JPG
}

Constants included from Settings

Settings::FALSE, Settings::TRUE

Instance Method Summary collapse

Methods included from Settings

included, #initialize, #to_hash

Instance Method Details

#[]Object

#[]=Object

#in=(v) ⇒ Object

Raises:

  • (ArgumentError)


27
28
29
30
31
# File 'lib/wkhtml/to_image/global_settings.rb', line 27

def in=(v)
  v = CommonSettings::cleanup_path(v)
  raise ArgumentError.new("#{v} is missing or not readable") unless CommonSettings::readable?(v)
  self['in'] = v
end

#out=(v) ⇒ Object

Raises:

  • (ArgumentError)


33
34
35
36
37
# File 'lib/wkhtml/to_image/global_settings.rb', line 33

def out=(v)
  v = CommonSettings::cleanup_path(v)
  raise ArgumentError.new("#{v} is not writeable") unless CommonSettings::writable?(v)
  self['out'] = v
end

#stdin=(v) ⇒ Object



39
40
41
# File 'lib/wkhtml/to_image/global_settings.rb', line 39

def stdin=(v)
  self.in = v ? CommonSettings::STDIN : nil
end

#stdout=(v) ⇒ Object



43
44
45
# File 'lib/wkhtml/to_image/global_settings.rb', line 43

def stdout=(v)
  self.out = v ? CommonSettings::STDOUT : nil
end