Class: StampIt

Inherits:
Object
  • Object
show all
Defined in:
lib/stamp_it.rb,
lib/stamp_it/version.rb,
lib/stamp_it/watermark.rb,
lib/stamp_it/background.rb

Defined Under Namespace

Classes: Background, Watermark

Constant Summary collapse

EXE_NAME =
'pdftk'
VERSION =
'0.0.8'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdftk_binary_path = nil) ⇒ StampIt

Returns a new instance of StampIt.



12
13
14
15
16
17
18
# File 'lib/stamp_it.rb', line 12

def initialize(pdftk_binary_path = nil)
  @config = {}
  @pdftk_cmd = pdftk_binary_path || find_pdftk_binary_path
  fail "Location of #{EXE_NAME} unknown" if @pdftk_cmd.empty?
  fail "Bad #{EXE_NAME}'s path: #{@pdftk_cmd}" unless File.exist?(@pdftk_cmd)
  fail "#{EXE_NAME} is not executable" unless File.executable?(@pdftk_cmd)
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



10
11
12
# File 'lib/stamp_it.rb', line 10

def config
  @config
end

#pdftk_cmdObject

Returns the value of attribute pdftk_cmd.



10
11
12
# File 'lib/stamp_it.rb', line 10

def pdftk_cmd
  @pdftk_cmd
end