Class: Preflight::Rules::MaxVersion

Inherits:
Object
  • Object
show all
Defined in:
lib/preflight/rules/max_version.rb

Overview

ensure the PDF version of the file under review is not more recent than desired

Instance Method Summary collapse

Constructor Details

#initialize(max_version) ⇒ MaxVersion

Returns a new instance of MaxVersion.



9
10
11
# File 'lib/preflight/rules/max_version.rb', line 9

def initialize(max_version)
  @max_version = max_version.to_f
end

Instance Method Details

#messages(ohash) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/preflight/rules/max_version.rb', line 13

def messages(ohash)
  if ohash.pdf_version > @max_version
    ["PDF version should be #{@max_version} or lower (value: #{ohash.pdf_version})"]
  else
    []
  end
end