Class: TestFile::PDFBuilder

Inherits:
Struct
  • Object
show all
Defined in:
lib/test_file/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#builderObject

Returns the value of attribute builder

Returns:

  • (Object)

    the current value of builder



63
64
65
# File 'lib/test_file/builder.rb', line 63

def builder
  @builder
end

Instance Method Details

#deleteObject



64
65
66
# File 'lib/test_file/builder.rb', line 64

def delete
  builder.delete
end

#exists?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/test_file/builder.rb', line 67

def exists?
  builder.exists?
end

#include?(content) ⇒ Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/test_file/builder.rb', line 73

def include?(content)
  reader.pages.map { |page| page.text }.join.include? content
end

#readerObject



70
71
72
# File 'lib/test_file/builder.rb', line 70

def reader
  PDF::Reader.new(builder.reader)
end