Exception: JSON::GeneratorError
- Defined in:
- lib/json/common.rb
Overview
This exception is raised if a generator or unparser error occurs.
Instance Attribute Summary collapse
-
#invalid_object ⇒ Object
readonly
Returns the value of attribute invalid_object.
Instance Method Summary collapse
- #detailed_message ⇒ Object
-
#initialize(message, invalid_object = nil) ⇒ GeneratorError
constructor
A new instance of GeneratorError.
Methods inherited from JSONError
Constructor Details
#initialize(message, invalid_object = nil) ⇒ GeneratorError
Returns a new instance of GeneratorError.
149 150 151 152 |
# File 'lib/json/common.rb', line 149 def initialize(, invalid_object = nil) super() @invalid_object = invalid_object end |
Instance Attribute Details
#invalid_object ⇒ Object (readonly)
Returns the value of attribute invalid_object.
147 148 149 |
# File 'lib/json/common.rb', line 147 def invalid_object @invalid_object end |
Instance Method Details
#detailed_message ⇒ Object
154 155 156 157 158 159 160 |
# File 'lib/json/common.rb', line 154 def (...) if @invalid_object.nil? super else "#{super}\nInvalid object: #{@invalid_object.inspect}" end end |