Class: Verapdf::Validator
- Inherits:
-
Object
- Object
- Verapdf::Validator
- Defined in:
- lib/verapdf/validator.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ Validator
constructor
A new instance of Validator.
- #valid?(flavour = '1b') ⇒ Boolean
Constructor Details
#initialize(path) ⇒ Validator
Returns a new instance of Validator.
8 9 10 |
# File 'lib/verapdf/validator.rb', line 8 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/verapdf/validator.rb', line 6 def path @path end |
Instance Method Details
#valid?(flavour = '1b') ⇒ Boolean
12 13 14 15 16 |
# File 'lib/verapdf/validator.rb', line 12 def valid?(flavour = '1b') output = `verapdf -f #{flavour} #{path}` xml = Nokogiri::XML(output) xml.at_xpath("//validationReport")["isCompliant"] == "true" end |