Class: WsdlMapper::Dom::Validator
- Inherits:
-
Object
- Object
- WsdlMapper::Dom::Validator
- Defined in:
- lib/wsdl_mapper/dom/validator.rb
Defined Under Namespace
Classes: Error
Instance Method Summary collapse
-
#initialize(schema) ⇒ Validator
constructor
A new instance of Validator.
- #validate ⇒ Object
- #validate_roots ⇒ Object
Constructor Details
#initialize(schema) ⇒ Validator
Returns a new instance of Validator.
16 17 18 |
# File 'lib/wsdl_mapper/dom/validator.rb', line 16 def initialize(schema) @schema = schema end |
Instance Method Details
#validate ⇒ Object
20 21 22 23 24 |
# File 'lib/wsdl_mapper/dom/validator.rb', line 20 def validate @errors = [] validate_roots @errors end |
#validate_roots ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/wsdl_mapper/dom/validator.rb', line 26 def validate_roots @schema.each_type do |type| next unless type.is_a?(::WsdlMapper::Dom::SimpleType) next if type.root.is_a?(::WsdlMapper::Dom::BuiltinType) @errors << Error.new(type, :invalid_root) end end |