Exception: XML_XSI::Schema::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- XML_XSI::Schema::ValidationError
- Defined in:
- lib/validate_xml_xsi.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, err, filename = nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(type, err, filename = nil) ⇒ ValidationError
Returns a new instance of ValidationError.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/validate_xml_xsi.rb', line 18 def initialize(type, err, filename = nil) @type = type @error = err @file = filename.nil? ? @error.file : filename @line = @error.line @column = @error.column if /((?:ERROR)|(?:WARNING)): /.match(@error.) @level = $1 @message = $' @description = "#{@type.to_s} #{@level.to_s} [#{@file}:#{@line}:#{@column}]: #{@message}".freeze else @level = '' @message = @error. @description = "#{@type.to_s} #{@message}".freeze end super(@description) end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def column @column end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def description @description end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def error @error end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def file @file end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def level @level end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def @message end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/validate_xml_xsi.rb', line 17 def type @type end |