Exception: Moxml::SerializationError
- Defined in:
- lib/moxml/error.rb
Overview
Error raised when serialization fails
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(message, node: nil, adapter: nil, format: nil) ⇒ SerializationError
constructor
A new instance of SerializationError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, node: nil, adapter: nil, format: nil) ⇒ SerializationError
Returns a new instance of SerializationError.
113 114 115 116 117 118 |
# File 'lib/moxml/error.rb', line 113 def initialize(, node: nil, adapter: nil, format: nil) @node = node @adapter = adapter @format = format super() end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
111 112 113 |
# File 'lib/moxml/error.rb', line 111 def adapter @adapter end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
111 112 113 |
# File 'lib/moxml/error.rb', line 111 def format @format end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
111 112 113 |
# File 'lib/moxml/error.rb', line 111 def node @node end |
Instance Method Details
#to_s ⇒ Object
120 121 122 123 124 125 126 127 |
# File 'lib/moxml/error.rb', line 120 def to_s msg = super msg += "\n Node: <#{@node.name}>" if @node.respond_to?(:name) msg += "\n Adapter: #{@adapter}" if @adapter msg += "\n Format: #{@format}" if @format msg += "\n Hint: Check that the node structure is valid for serialization" msg end |