diff --git a/lib/prawn/embedded_files.rb b/lib/prawn/embedded_files.rb index 7e055ccc8..f82af36a6 100644 --- a/lib/prawn/embedded_files.rb +++ b/lib/prawn/embedded_files.rb @@ -32,7 +32,7 @@ def file(src, options = {}) filespec = Filespec.new(file_obj, options) filespec_obj = filespec.build_pdf_object(self) - unless filespec.hidden + unless filespec.hidden? # Wait for pdf-core PR # attach_file(filespec.file_name, filespec_obj) diff --git a/lib/prawn/embedded_files/filespec.rb b/lib/prawn/embedded_files/filespec.rb index 465c8459e..5fd3f4c94 100644 --- a/lib/prawn/embedded_files/filespec.rb +++ b/lib/prawn/embedded_files/filespec.rb @@ -3,7 +3,7 @@ module Prawn module EmbeddedFiles class Filespec - attr_reader :file_name, :not_hidden + attr_reader :file_name def initialize(file, options = {}) name = options[:name] || file.chksum @@ -15,15 +15,12 @@ def initialize(file, options = {}) @description = PDF::Core::LiteralString.new(desc_str) end - if options[:hidden].nil? || options[:hidden] != true - @not_hidden = true - end - + @hidden = !options[:hidden].nil? && options[:hidden] == true @file = file end - def hidden - !@not_hidden + def hidden? + @hidden end def build_pdf_object(document)