Class: Saddler::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/saddler/validator.rb

Class Method Summary collapse

Class Method Details

.valid?(data) ⇒ Boolean

NOTE: This is easy check

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
# File 'lib/saddler/validator.rb', line 4

def self.valid?(data)
  REXML::Document.new(data)
  true
rescue REXML::ParseException => e
  exception = InvalidXMLError.new(e.message)
  exception.set_backtrace(e.backtrace)
  raise exception
end